using OpenRecordSet to improve linked table performance
using OpenRecordSet to improve linked table performance
(OP)
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!
RE: using OpenRecordSet to improve linked table performance
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