Share via


Visual Basic: RDO Data Control

Connect Property Example: DSN Connection Using Establish Connection

The following example establishes an ODBC connection using a registered DSN to provide most of the required arguments. The User ID and Password are to be provided by domain-managed security. In this case the example prints the resulting Connect property to the Immediate window.

  Dim cn As New rdoConnection
Dim qd As New rdoQuery

cn.Connect = "uid=;pwd=;"DSN=WorkDB;"
cn.cursordriver = rdUseOdbc
cn.EstablishConnection rdDriverNoprompt
debug.print cn.Connect