Persistent connection to backend

emorris1000

Registered User.
Local time
Today, 12:54
Joined
Feb 22, 2011
Messages
125
I'm adding a little duct tape to my split design and trying to maintain a simple persistent connection that opens and closes with the switchboard, and I think I've got it working but I want to make sure I'm not doing something completely moronic. I appreciate that in terms of style there are issues, but will this cause performance problems?



Public dbsOpen As Dao.Database
Private Sub Form_Load()
Dim StrDBName As String

StrDBName = "XXXXXXXXXXXXXXXXX"

Set dbsOpen = OpenDatabase(StrDBName)

End Sub



Private Sub Form_Close()

dbsOpen.close

End Sub
 
Are you using linked tables in this Access application of yours?
If so - it's worth considering having a simple or even dummy table in the BE that you hold a recordset open to - so that the connection that is persisted is the same one your linked tables are using. You could repeatedly open database object using OpenDatabase, but they progressively count towards your maximum number of connections. (Which is 255 and so unlikely to be reached - but that's a theoretical limit, you'd get less - and need to bear in mind multiple users perhaps?)

Cheers.
 

Users who are viewing this thread

Back
Top Bottom