我正在使用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
此致