Microsoft KB Archive/166107

{|
 * width="100%"|

INFO: DAO/Jet Cannot Be Used in Transaction Server Components

 * }

Q166107

-

The information in this article applies to:


 * Microsoft Transaction Server 1.0

-

SUMMARY
Microsoft Data Access Objects (DAO) using the Jet Engine cannot be used within a Microsoft Transaction Server component.

MORE INFORMATION
When given incomplete or incorrect information about an ODBC Data Source, Jet invokes a dialog box to prompt the user for the correct or complete information. Because the component is running on a server that may be unattended, or because the component may not have access to the desktop, a logon dialog box has the effect of causing the component to stop responding.

Calling SQLDriverConnect with the SQL_DRIVER_NOPROMPT flag prevents this from occurring. However, Jet does not invoke SQLDriverConnect with this flag. ODBC 3.0 Connection Pooling requires SQL_DRIVER_NOPROMPT; therefore, Microsoft Transaction Server denies a connection to any component that does not use this flag.

The C++ Classes, MFC DAO, only provide DAO connection with Jet, and therefore cannot be used. The C++ DAO SDK 3.5 classes do provide ODBCDirect, which is really a separate engine from Jet (by way of RDO). You can specify a flag (dbDriverNoPrompt) in the OpenConnection method with ODBCDirect that enables the SQL_DRIVER_NOPROMPT flag. Likewise, DAO 3.5 within Visual Basic 5.0 also offers ODBCDirect.

Other database connectivity alternatives include the following:


 * Use ADO.
 * Use RDO.
 * Use ODBC API.
 * Use DAO 3.5 with the ODBCDirect engine.
 * Use MFC ODBC Database Classes, but use OpenEx instead of Open, because OpenEx allows you to specify SQL_DRIVER_NOPROMPT.