Results 1 to 3 of 3
  1. #1
    OceanaPolynom is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    20

    Need for Speed

    Hello

    I am writing coordinates to a .mdb file from an ascii text file using vba inside of AutoCad. My code looks like this:


    Set dbsObj = DBEngine.Workspaces(0).OpenDatabase("c:\JHL1\temp. mdb")
    Set rstObj = dbsObj.OpenRecordset("tblcoorsJHL2", dbOpenTable)
    Do

    .
    .
    .

    rstObj.AddNew
    rstObj!yxdata = Val(ya$) * 100
    rstObj!xxdata = Val(xa$) * 100
    rstObj!zxdata = Val(za$) * 100
    rstObj.Update

    .
    .
    .
    Loop Until TheEnd

    Access 2003 is installed on my computer. The numbers are stored as long integers. The db file is indexed on the key and y and x fields. This code works ok, but I'd like to know if it is possible to make it go faster. I have to deal with a large number of points (in the millions). In another part of the code I retrieve a smaller number of points (in the thousands) by using a SQL statement.

    Thank you all

    John

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi,

    I don't know the layout of your ASCii file, but if you can get it in a delimited form as:

    XData;Ydata;ZData
    1;2;3
    10;20;30

    or even in a fixed width form like:
    XData: position 1 to 10; YData: position 11to 20 and ZData: position 21 to 30
    1.........2.........3..........
    10........20........30........
    100.......200.......300.......

    you can import the data directly in Access in temporary table and then add them to the coördinates table through an append query.

    greetings
    NG

  3. #3
    OceanaPolynom is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2010
    Posts
    20

    N 4 s

    Hello
    1st thanks for taking the time to help.
    My data is in either of the 2 formats you mentioned
    If your solution is faster than what I wrote, it could be a big help to me
    I will start looking for a way to do what you suggest.

    Thanks very much

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Increase search speed
    By kjuelfs in forum Queries
    Replies: 3
    Last Post: 07-12-2010, 05:11 AM
  2. Dsum causing speed issue
    By ethoemmes in forum Queries
    Replies: 0
    Last Post: 07-06-2010, 05:22 AM
  3. Query speed issues
    By thart21 in forum Queries
    Replies: 2
    Last Post: 04-07-2010, 05:16 PM
  4. Speed issue
    By hey23 in forum Queries
    Replies: 1
    Last Post: 06-24-2009, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums