我正在尝试从我的 excel 宏连接到 Oracle DB。当我在安装了 Oracle 组件的笔记本电脑上运行此宏时,它运行良好。当我在没有安装 Oracle 组件的笔记本电脑上运行它时,它会抛出一个错误提示Could not connect to the database. Check your username and password. Oracle client and networking components were not found. These components are part of Oracle 7.3.3 or later client software installation
。
我正在尝试使用以下参数连接到 Oracle:-
Dim dbConnect As ADODB.Connection
Dim strUserName As String
Dim strPassword As String
Dim strDatabase As String
Set dbConnect = New ADODB.Connection
dbConnect.Open ( _
"User ID=" & strUserName & "; Password=" & strPassword & "; Data Source=" & strDatabase & "; Provider=msdaora")
我们的大多数用户没有安装 Oracle。