See
ConnectionString Property (ADO)[
^],
Connection String Syntax[
^] and
Open Method (ADO Connection)[
^]. Use the documentation to help you construct your ConnectionString and then, if it does not work, ask a specific question.
Explanation of Connection object Open Method parameters in your example
Syntax:
ConnectionString
Optional. A String value that contains connection information. See the ConnectionString property for details on valid settings.
UserID
Optional. A String value that contains a user name to use when establishing the connection.
Password
Optional. A String value that contains a password to use when establishing the connection.
Options
Optional. A ConnectOptionEnum value that determines whether this method should return after (synchronously) or before (asynchronously) the connection is established.
Details of each parameter
First Parameter (ConnectionString)
* Provider - The interface between your program and the database engine. There are several options. SQLOLEDB is the ADO.NET provider for Microsoft SQL Server.
* Data Source - The database server name or IP Address
* Initial Catalog - The name of the database on the database server
* User Id - A username configured into the database server
* Password - A password configured into the database server
Second Parameter (User Id)
First empty string - User Id passed as parameter instead of in ConnectionString
Third Parameter (Password)
Second empty string - Password passed as parameter instead of in ConnectionString
Fourth Parameter (Options)
ADODB::adConnectUnspecified - Specifies that the connection should be a synchronous connection. See
ConnectOptionEnum[
^]
Note
If you use
Integrated Security
, you do not need to use
User Id
and
Password
in the ConnectionString or in the Open statement.