データ・ソースへの接続を開きます。このメソッドには、プロバイダおよびデータベースの場所を指定する接続文字列が必要です。
構文
Object.Open(ConnectionString)
引数:
Object: 必須。常にADODB Connectionオブジェクトの名前。
ConnectionString: 必須。プロバイダおよびデータベースの場所を指定します
備考
次の例では、Openメソッドの使用方法を示します。
例1:
'Create ADODB.Connection Object
Dim ConnObj ' Create a variable.
Set ConnObj = CreateObject("ADODB.Connection")
ConnObj.Open("ConnectionString") 'Creates DB Connection by Using Connection String
ConnObj.Close()
Set ConnObj = Nothing