ConnectTo (ODBCConnection - LotusScript)

Connects to a data source.

Defined in

ODBCConnection

Syntax

status = odbcConnection . ConnectTo( dataSourceName$ [ , userID$ [ , password$ ]] )

Parameters

dataSourceName$

String. The ODBC name of the data source to which you want to connect.

userID$

String. Optional. The name of the user ID.

password$

String. Optional. The password for the user ID.

Return value

  • True indicates that the connection to the data source was successfully achieved.
  • False indicates that the connection to the data source failed.

Usage

Use to establish a connection to a data source. The source must already be registered in the ODBC Driver Manager. This method does not automatically register data sources.

Errors

Cannot find named data source (DBstsCANF)

Unable to connect (DBstsCCON)

Unable to get user ID and password (DBstsACCS)

Events

BeforeConnect

AfterConnect

BeforeConnectTo

AfterConnectTo

Example