Close 方法

關閉資料庫的連線。

語法

Object.Close()

引數 - Object必要。一律是 ADODB Connection 物件的名稱

備註

下列範例說明 Close 方法的用法。

範例 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
'Do all the operations by using ADODB Connection Object based on the requirement
ConnObj.Close()
Set ConnObj = Nothing