急急急!!VBA 连接Oracle数据库时,报错未找到提供程序,可能程序未正确安装

我是一个门外汉,搞电气自动化的,项目里有一个功能需要用到VBA连接数据库,显示产量数据,现在遇到这么一个问题,已经处理了一个月,还是没有什么进展,故到论坛请教大神指导!!

下边是我的代码:
Dim Conn As New ADODB.Connection
Dim Rec1 As New ADODB.Recordset

Dim sConn As String
Dim sRec1 As String

'On Error GoTo Error_Handle

 sDBIP = "10.67.100.27"
 sDBName = "MESPDS1"
 sDBUser = "MESPDS"
 sDBPassword = "123456"

Set oGroup = Application.CreateTagGroup(Me.AreaName, 500)
oGroup.Add "CS\ShiftTarget0"
oGroup.Add "CS\ShiftActual"
oGroup.Add "CS\CurrentPlanned"
oGroup.Add "CS\CurrentActual0"
oGroup.Add "CS\Loading"
oGroup.Add "CS\Rework"
oGroup.Add "CS\Start"
oGroup.Add "CS\End"

Set tSP = oGroup.Item("CS\ShiftTarget0")
Set tSA = oGroup.Item("CS\ShiftActual")
Set tCP = oGroup.Item("CS\CurrentPlanned")
Set tCA = oGroup.Item("CS\CurrentActual0")
Set tLD = oGroup.Item("CS\Loading")
Set tRJ = oGroup.Item("CS\Rework")

sConn = "provider=OraOLEDB.Oracle.1;User Id=MESPDS;"
sConn = sConn & "Password=123456;"
sConn = sConn & "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.67.100.27)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MESPDS1)));"

sRec1 = "select P.SHIFT_PLAN_QUANTITY_I,P.SHIFT_ACTUAL_QUANTITY_I,P.CURRENT_PLAN_QUANTITY_I,P.ACTUAL_COMPLETE_QUANTITY_I,P.ACTUAL_START_QUANTITY_I,P.REWORK_QUANTITY_I,TO_CHAR(P.SHIFT_START_TIME_T,'HH24:mm'),TO_CHAR(P.SHIFT_END_TIME_T, 'HH24:mm') from AT_AS_MM_PMC_PRODUCTIONCOUNT P WHERE P.PLINE_NAME_S = 'I032JJ03';"

Conn.Open sConn
Rec1.Open sRec1, sConn

tSP.Value = Rec1(0)
tSA.Value = Rec1(1)
tCP.Value = Rec1(2)
tCA.Value = Rec1(3)
tLD.Value = Rec1(4)
tRJ.Value = Rec1(5)

Rec1.Close
Conn.Close
End Sub

报错截图:
图片说明
运行到Conn.OPEN,就不行了,提示未找到程序,在网上搜的各种方法以及各种连接字符串都湿了个遍,还是不行,实在是走投无路了,特来发帖,请教专业大神,望指导,在线等~~~~
oracle客户端安装了,在客户端配置了NET Manager,也通了,那些.dll文件也放在相应的位置了,就是始终报这个错,不知道还有哪些地方需要配置或者是连接字符串里的provider不对?

查看全部
qq_34725360
Sunnddaay
2017/11/06 07:05
  • oracle
  • string
  • vba
  • 数据库
  • 点赞
  • 收藏
  • 回答
    私信

2个回复