View Full Version : Opendatabase Method & Linked Tables Performance


Banana
07-22-2008, 12:12 PM
I'm hoping someone can help clarify this; FMS Inc has a great article (http://www.fmsinc.com/free/NewTips/Access/LinkedDatabase.asp) about how to improve performance by having a persistent connection using OpenDatabase method, which interestingly enough, was what I did before I found the article but for different reasons.

The only thing I am not quite sure is this essentially means we now have X database variables, X being the numbers of different backend we link to and two separate connections to same backend.

The Access Help also says:
Note When you access a Microsoft Jet-connected ODBC data source, you can improve your application's performance by opening a Database object connected to the ODBC data source, rather than by linking individual TableDef objects to specific tables in the ODBC data source.

Does it then means that I could just OpenDatabase, then bind forms using tables from that variable? I had thought that all forms/controls/queriers/any other Access objects will always work through default database?

Should I then make sure that my objects refer to the second variable, rather than default database, even if they may be almost identical.

Note:
?DBEngine(0)(1) is DbEngine(0)(0)
False <-- I thought they were same? But then, I supplied ODBC connection so...

DBEngine(0)(0).TableDefs.Count
40

DBEngine(0)(1).TableDefs.Count
34 <-- six less, which is just the numbers of all MSys tables

Pat Hartman
07-23-2008, 07:05 PM
Leave the tables as linked. Access opens the be each time it needs to access the tables there if the be is not already open. The point of the persistant connection is that it eliminates the need to potentially reopen the be multiple times within the application. So just opening a connection to the database should suffice. However, there is a downside to this and that is that it will ultimately reduce the number of concurrent users the be can support.

Banana
07-23-2008, 07:29 PM
So I just leave that second instance alone for the lifetime of application and work everything through the default databae then? It's still same thing, right? ('It' being the linked tables)

Thanks for reassurance. :)