我正在使用DAO驱动程序在VBA中建立到Oracle数据库的ODBC连接,但是最后一个连接到数据库的用户将保留一段时间,并覆盖新的给定凭据。下面是与此问题相关的代码段。可以刷新或更新数据库对象吗?
dim DB as DAO.Database
dim DBName as String
dim Datenbank_BuildConnectionString as String
DBName = "TNS database"
Datenbank_BuildConnectionString = "ODBC" & _
";DSN=" & "database name" & _
";Uid=" & "adada" & _
";Pwd=" & "password"
Set DB = DAO.Workspaces(0).OpenDatabase(DBName, dbDriverNoPrompt, True, Datenbank_BuildConnectionString)
Call DB.Close
Set DB = Nothing