次の方法で共有


Connect Method

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The Connect method attempts to establish a connection with a named instance of Microsoft SQL Server.

構文

object
.Connect( [ ServerName ] , [ Login ] , [ Password ] )

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • ServerName
    Optional. A string that specifies a named instance of SQL Server.
  • Login
    Optional. A string that specifies a SQL Server login by name.
  • Password
    Optional. A string that specifies a password authenticating the SQL Server login.

Prototype (C/C++)

HRESULT Connect(SQLDMO_LPCSTR Server = NULL,
SQLDMO_LPCSTR Login = NULL,
SQLDMO_LPCSTR Password = NULL);

解説

When the ServerName argument is not specified, the SQL Distributed Management Objects (SQL-DMO) application attempts to connect to an instance of SQL Server using the network name of the computer on which the application is running. If that computer is also running an instance of SQL Server, a connection is established to that instance of SQL Server.

Use the Login and Password arguments to specify values used for SQL Server Authentication. To use Windows 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.

Applies to:

SQLServer Object

参照

関連項目

LoginSecure Property
LoginTimeout Property

ヘルプおよび情報

SQL Server 2005 の参考資料の入手