ADO vs DAO Access 2007

L

Larry Novreske

What is the equivalent ADO code to open the ODBC dialog which allows a user
to select or create and then select the DSN of an ODBC data source.

In earlier versions of Access, using DAO the following code is used.

public function fnGetODBCConnect () as string
Dim wrkODBC As Workspace
Dim conPubs As Connection

Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)

Set conPubs = wrkODBC.OpenConnection("Connection", dbDriverPrompt, True,
"ODBC;DSN=MyDSN;")

fnGetODBCConnect = conPubs.Connect
Exit Function

Which would open up the ODBC dialog for creating/selecting a DSN and allow
me to get the connect string to an ODBC data source.

In all of the examples of ADO connections, all they show is keying in the
connect string which is not what I need.
 
Top