Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO recordset on Dual Core slow

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
0
0
AU
Further to thread708-1465811, I used below (found various places on this forum) and it takes only a second to open a 50k entry database with 20 columns on a Core Duo.

However you must have the database column that you use ORDER by Indexed, otherwise it takes much longer if data has been added at random and your critera contains an ORDER statement.
The initial 50 line Datagrid does not have any database settings so you have to set column names manually (or temporarily use an ADO control).

If the database is on a remote machine and slow network then it could take longer.
Code:
' Open database conection
Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PathName & "\" & FileName
RS.CursorLocation = adUseClient
RS.Open Criteria, CN, adOpenStatic, adLockOptimistic ' Opening the recordset
Set DataGrid.DataSource = RS ' This datagrid is now configured to Timetable table so data can be viewed or changed.
'As you scroll, it gets the next data
Close it only after you have finished with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top