Click to See Complete Forum and Search --> : recordset question


rockinron
January 12th, 2003, 10:01 AM
i have been working on upgrading my project to an ADO recordset.

my previous method was "Flat files". the recordset system seems to be lacking in some ways. when i wanted a certain record in a flat file, i just ran this code: get #1, 500, Incident

and it went to the record instantly. with a recordset, there is no similar command so the things that took a split second in the flat files takes many seconds now(12). does anybody have an idea of what code may bring back my speed???

i have tried the filter and it is also slow.

i would like to try the Find function but i do not know the correct syntax.

i have a field: IncidentID with a number and i want to find it quick upon demand. i have a variable: Z and i want to find the record with the same value QUICK.

any ideas??????

TheCPUWizard
January 12th, 2003, 10:28 PM
When looking up records it is almost always the most efficient to to the lookup by a unique index. Have you set up the proper indices? Have you Activated them?

You do not post enough information for any of us to make more than very general suggestions (akak guesses).....

rockinron
January 13th, 2003, 04:50 AM
i am using an auto increment to obtain the desired records.

ADO seems to be a lot slower than my old flat files.

b = 12

rsincidents.movefirst
for Z = 1 to rsincidents.recordcount

if rsincidents("IncidentID").value &
"" = B then exit for



rsincidents.movenext
next


in most cases i will need 100's of these at a time, i do another loop(from a flat file) to run thru the required #'s.

i am very dissappointed in ADO. except for being on a network, the flat files are much faster.



for LL = 1 to numrecs1
get #1, LL, holdfile

b = holdfile.storednumber

rsincidents.movefirst
for Z = 1 to rsincidents.recordcount

if rsincidents("IncidentID").value &
"" = B then exit for



rsincidents.movenext
next

' i load the grid here
call loadflexgrid



next



i did get the find function figured out but it is still very slow


i have a 1.6ghz, pent 4