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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using OpenRecordSet to improve linked table performance

Status
Not open for further replies.

storer

Programmer
Mar 27, 2000
41
0
0
US
In the Access 97 help files, I found some info on "greatly enhancing performance when opening the main database and opening tables and forms by forcing the linked database to remain open. To do this create an empty table in the linked database (back end?) and link the table in the main database (front end?). Then use the OpenRecordset method to open the linked table." I can't find any info on HOW to use the OpenRecordset method to do this. Any help? Thanks!
 
I can't imagine why you can't find OpenRecordset in the help file. Maybe your help file is corrupted?

Anyway, what you need to do is define a couple variables in a standard module:
Dim dbDummy As Database, rstDummy As Recordset
Then, in your application's startup code (the Form_Open for your main form, most likely) place the following code
If rstDummy Is Nothing Then
Set dbDummy = CurrentDb()
Set rstDummy = dbDummy.OpenRecordset("DummyTable")
End If

IT IS IMPORTANT that before your application terminates, you close this recordset and database as follows:
If Not rstDummy Is Nothing Then
rstDummy.Close
Set rstDummy = Nothing
Set dbDummy = Nothing
End If
If you fail to do this, it's possible that Access will minimize to the task bar instead of shutting down, and you'll have to End Task from the Task Manager (Ctrl-Alt-Delete). If this happens, you will also lose a little bit of your RAM until the next time you reboot. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top