Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Using Large Dynasets

Question:
I have a VB app that I use to correct records on an Rdb database on a VAX. I am using Microsoft's TCP/IP and DEC's ODBC drivers. Our databases can get VERY large (in the hundreds of thousands to millions). I create a Dynaset of an entire table and start at the beginning. Almost none of my users will begin their editing process there - they need a means to launch to the record they want. It seems that FindFirst is much too slow (a few hours) to ever be useful. I'd like to make use of the indexes, but it seems I can't create Table objects with ODBC, so "Seek" appears to be unavailable as an option. My solution thus far has been to create only dynasets of one record. This is still too slow. Is there a better way to get to my records? I've read just about everything I can get my hands on.

Answer:
A couple of notes that are fairly obvious to you: Dynasets are slower than snapshots, since they have to create a connection to the database. Also, the ODBC is going to slow it down somewhat more, but it is negligible after the first operation.

What about providing your users with an intermediate search screen? It sounds like they know what they want to edit, they just have to get there. If you can narrow that million records down to a few thousand, things will run much better. As far as searching recordsets, you will probably have to do something like this:

dDm iFound as integer
iFound = False
dsData.MoveFirst
Do While not dsData.EOF and not iFound
   iFound = dsData(field) = 'criteria'
   if not iFound then dsData.MoveNext
Loop
This is reliable for searching dynasets and snapshots.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date