|
-
Jan 11th, 2000, 03:40 AM
#1
Thread Starter
New Member
does anyone know how to load a collection from a database (encapsulation) without using the
for each ffield in rrecordset
.
.
.
next ffield
or for i = 1 to rrecordset.count ... next i?
i'm dealing with a huge database, and this just takes TOO LONG.
ideas?
skiegig
------------------
Remembering games and daisy chains and laughs, got to keep the loonies on the path....
-
Jan 11th, 2000, 05:01 AM
#2
If you post your code then someone may be able to help you speed it up.
------------------
Marty
-
Jan 11th, 2000, 08:34 PM
#3
Thread Starter
New Member
Okay, here's the way I do it now. This opens the recordset and loads each record one by one using the recordcount property...
Public Sub Retrieve(cnxConnection As ADODB.Connection)
Dim rstGeneric As New ADODB.Recordset
'load data from database
rstGeneric.Open mConnect, cnxConnection, adOpenStatic
For i = 1 To rstGeneric.RecordCount
Add rstGeneric!F1, rstGeneric!LocLevel1 & " " & rstGeneric!LocLevel2 & " " & _
rstGeneric!LocLevel3 & " " & rstGeneric!LocLevel4 & " " & rstGeneric!LocLevel5, CStr(i)
rstGeneric.MoveNext
Next i
rstGeneric.Close
Set rstGeneric = Nothing
End Sub
any help would be appreciated
------------------
Remembering games and daisy chains and laughs, got to keep the loonies on the path....
-
Jan 12th, 2000, 12:25 PM
#4
Guru
you could use the .GetRows method of the ADO Recordset. That will put all data into a 2 dimensional array, which would probably be faster then accessing the properties of a recordset. If you try this, let us know if it is faster, thanks
Tom
-
Jan 13th, 2000, 01:43 AM
#5
Member
SkieGig,
Tom brings up an excellent point. Have a look at the web link below to see some comparative benchmarks. I've conducted my own tests and GetRows is faster. I use it all the time to load global arrays for listbox and combobox data.
http://msdn.microsoft.com/library/pe...aretrieval.htm
Gerald
-
Jan 13th, 2000, 01:50 AM
#6
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
|