Article ID: 166392 - Last Review: July 13, 2004 - Revision: 2.1 How To Use "DSN-Less" ODBC Connections with RDOThis article was previously published under Q166392 On This PageSUMMARY
With Microsoft Visual Basic versions listed above, you can specify your
ODBC driver and server in your connect string when using RDO (Remote Data
Objects) and DAO (Data Access Objects). This eliminates the need to set up
a DSN (Data Source Name). This is called a "DSN-Less" ODBC connection
because you do not need to set up a DSN in order to access your ODBC
database server.
To do this, you specify a "driver=" parameter in your connect property. The following three examples show how this is done with the SQL Server, Access, and Oracle ODBC drivers: NOTE: The driver name must be surrounded by curly brackets. For example:
"{SQL Server}"
The following information is taken from Visual Basic Books Online:
The connect string contains a series of semi-colon-delimited
arguments as defined by the ODBC interface - including the
ODBC driver itself. That is, all ODBC drivers have specific
argument requirements so you should consult the documentation
included with the driver for specific information. This
connect string is passed to the ODBC API SQLDriverConnect
function along with the hEnv for the associated rdoEnvironment
object.
MORE INFORMATION
If you do want to set up a DSN, you can use the following methods:
Sample ProgramThe following RDO example uses a "DSN-less" ODBC connection so you do not need to set up a DSN with the ODBC Admin utility beforehand.
REFERENCES
In Visual Basic Books Online see:
Guide to Building Client Server Applications in Visual Basic (Enterprise)
Part 3: Data Access Options
Using Remote Data Objects and the Remote Data Control
Establishing an RDO Connection
Providing Connection Strings to RDO
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Jon Fowler, Microsoft Corporation | Article Translations
|
Back to the top
