|
-
Aug 22nd, 2000, 08:32 AM
#1
Thread Starter
PowerPoster
I have a form which, when the user selects an item from a combo box, connects and retrieves two feild items and returns data (kinda of a lookup table). I want to know if I could load the values in an array, and then retrieve the values from the array rather than the database. It seem that it would be quicker.
My problem, not familiar with arrays. Can anyone help?
-
Aug 22nd, 2000, 08:45 AM
#2
Member
It really depends on how big each record is, if it's huge it will take a lotta memory and time to load. The way i would do it is to load each record into a object (use the class builder to help if you are not farmilliar with objects) and then define a array/collection of the object like so:
'this would be in the class module (Address):
public strFirstName as string
public lngPhoneNo as long
'this would be in the module:
dim colTemp() as new Address
then you could access the array or collection through a simple do loop like:
do until c = ubound(colTemp)
'import code goes here
c = c + 1
loop
this works okay if you have a small DB bus if you are working with huge databases i would not recommend this..
if you would like to learn arrays or collections, go to the tutorial section of VBWorld and read Karl Moore's tutorials.
p.s. i cant garantee that the code supplied above will work, infact knowing me and my sloppy programming it probably wouldn't :-)
Good Luck
Thanx, for your reply(s)
Zhang Tian Hao
Visual Studio Enterprise 6.0 SP 4
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|