The Connect method attempts to establish a connection with the Microsoft® SQL Server™ installation named.
object.Connect( [ ServerName ] , [ Login ] , [ Password ] )
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
ServerName | Optional. A string specifying a SQL Server installation by name. |
Login | Optional. A string specifying a SQL Server login by name. |
Password | Optional. A string specifying a password authenticating the SQL Server login. |
When the ServerName argument is not specified, the SQL-DMO application attempts to connect to a SQL Server installation using the network name of the computer on which the application is running. If that computer is also running SQL Server, a connection is established to that SQL Server installation.
Use the Login and Password arguments to specify values used for SQL Server Authentication. To use Windows NT Authentication for the connection, set the LoginSecure property to True prior to calling the Connect method. When LoginSecure is True, any values provided in the Login and Password arguments are ignored.
HRESULT Connect(SQLDMO_LPCSTR Server = NULL,
SQLDMO_LPCSTR Login = NULL,
SQLDMO_LPCSTR Password = NULL);
LoginSecure Property | LoginTimeout Property |