DAO, ODBC, and Shared Memory
Melson Employee -- jwallenf@interaccess.com Thursday, January 18, 1996 Hello All, Background: I have a Database DLL (DB.DLL), wrapping up CDatabase as CMTDatabase and CRecordSet as CMTRecordSet, which is used by my Business Objects DLL (Factory.DLL) which is inturn used within the applications. I would like there to be only one shared database connection. I am using VC/MFC 4.0 on 95 and MS SQL Server 4.21 and 6.00. Problem: I have having difficulty making one shared database connection. I have tried using a shared data segment and also a Memory-Mapped File, in both cases the second instance of the application the m_hdbc is not valid. Is the ODBC connection handle m_hdbc owned by the process it was started in or is it a globally maintained value? Does anyone have any ideas how to share a single connection between multiple exe's. Question: Does DAO share a single database connection? How much does DAO differ from standard ODBC? I know that DAO uses the Jet Database for ACCESS database, but also uses ODBC, so is Microsoft recommending companies switch to the DAO interface instead? Would there be problems with DAO and Oracle, SQL Server, or SyBase? I applogize right now if some of the DAO question are not worded correctly, I have just started to look into DAO. Thank you, Jason Wallenfang jwallenf@interaccess.com
Darren Martz -- martz%mspo3@mprgate.mpr.ca Friday, January 19, 1996 I have not (as of yet) done the shared connection, but I do know a bit about the next generation of ODBC, and the purpose of DAO. From what I understand, Cairo will have a set of interfaces that will replace ODBC with an enriched feature set. I image that there will be something like: IDBConnection and IDBStatement and there will be a series of CLIID's for various drivers whereas the DAO engine would also support the IDBConnection and IDBStatement interfaces. Confusing? It won't be withing a year... or two... As for DAO, it *CAN* use ODBC, but my hard-drive can also be used to host OS/2 - doesn't mean it's a good idea. From what I know, DAO was designed for the smaller applications that use formats like dBase and FoxPro. Because it is from Microsoft it defaults to using the JET engine. The layers of ODBC talking to JET are as follows: ODBC ODBC Jet Driver DAO Interface Jet Engine Whereas the layers of ODBC through DAO are as follows: DAO Interface ODBC Engine ODBC ODBC SQLServer Driver CTLib I hope that adds to your understanding :) Darren martz@mpr.ca ---------- From: owner-mfc-l[SMTP:owner-mfc-l@netcom.com] Sent: Thursday, January 18, 1996 9:42 AM To: mfc-l Subject: DAO, ODBC, and Shared Memory Hello All, Background: I have a Database DLL (DB.DLL), wrapping up CDatabase as CMTDatabase and CRecordSet as CMTRecordSet, which is used by my Business Objects DLL (Factory.DLL) which is inturn used within the applications. I would like there to be only one shared database connection. I am using VC/MFC 4.0 on 95 and MS SQL Server 4.21 and 6.00. Problem: I have having difficulty making one shared database connection. I have tried using a shared data segment and also a Memory-Mapped File, in both cases the second instance of the application the m_hdbc is not valid. Is the ODBC connection handle m_hdbc owned by the process it was started in or is it a globally maintained value? Does anyone have any ideas how to share a single connection between multiple exe's. Question: Does DAO share a single database connection? How much does DAO differ from standard ODBC? I know that DAO uses the Jet Database for ACCESS database, but also uses ODBC, so is Microsoft recommending companies switch to the DAO interface instead? Would there be problems with DAO and Oracle, SQL Server, or SyBase? I applogize right now if some of the DAO question are not worded correctly, I have just started to look into DAO. Thank you, Jason Wallenfang jwallenf@interaccess.com
| Вернуться в корень Архива |