|
-
Feb 13th, 2001, 10:34 AM
#1
Thread Starter
Addicted Member
i have a form, which requires when loading up to extract data from three different tables in side one database.
currently what i am doing is opening up a new connection to the three tables and then opening them
seperatly
this takes a long time to do as there are more than 3000 entries in one table,
is there any way i can speed it up even a little bit
here is my code right now
i am sure that there is another way of doing this
Private Sub Form_Load()
Set rs = New Recordset
Set rs3 = New Recordset
Set rs4 = New Recordset
Dim Table1 As String
Dim te As Table
Table1 = "auditlog"
rs.ActiveConnection = "Provider=Microsoft." & "Jet.OLEDB.4.0;Data Source=P:\Tracker\EPCS\EPCS_Tracker_app.mde;" & "Persist Security Info=False"
rs.Open "select * from [Change Request/Fault Summary Table]", , adOpenKeyset, adLockOptimistic
rs3.ActiveConnection = "Provider=Microsoft." & "Jet.OLEDB.4.0;Data Source=P:\Tracker\EPCS\EPCS_Tracker_app.mde;" & "Persist Security Info=False"
rs3.Open "select * from [Intech Staff]", , adOpenKeyset, adLockOptimistic
rs4.ActiveConnection = "Provider=Microsoft." & "Jet.OLEDB.4.0;Data Source=P:\Tracker\EPCS\EPCS_Tracker_app.mde;" & "Persist Security Info=False"
rs4.Open "select * from [Status Pick List]", , adOpenKeyset, adLockOptimistic
rs.MoveLast
intRecCount = rs.RecordCount
rs.MoveFirst
For intCounter = 1 To intRecCount
Combo1.AddItem rs![Change Request /Fault Number]
rs.MoveNext
Next intCounter
rs3.MoveLast
intRecCount = rs3.RecordCount
rs3.MoveFirst
For intCounter = 1 To intRecCount
Combo4.AddItem rs3![Staff Name]
Combo5.AddItem rs3![Staff Name]
Combo6.AddItem rs3![Staff Name]
Combo7.AddItem rs3![Staff Name]
rs3.MoveNext
Next intCounter
rs4.MoveLast
intRecCount = rs4.RecordCount
rs4.MoveFirst
For intCounter = 1 To intRecCount
Combo8.AddItem rs4![Status]
Combo9.AddItem rs4![Status]
Combo10.AddItem rs4![Status]
Combo11.AddItem rs4![Status]
rs4.MoveNext
Next intCounter
Combo1.Text = envfaultnum
End Sub
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
|