Не удается найти поставщика данных OleDB VBA / Excel

Я почти не знаком с VBA (у меня было несколько курсов в школе, и этосидеть). Теперь мне нужно подключиться к базе данных Oracle (которая работает на удаленном сервере) из файла Excel. Я'я поглядел вокруг и нашел несколько примеров. Итак, я написал следующий код:

    Sub Try()
         Dim cn As New ADODB.Connection
         Dim rs As ADODB.Recordset
         Dim cmd As ADODB.Command
         Dim chunk() As Byte
         Dim fd As Integer
         Dim flen As Long
         Dim Main As ADODB.Parameter
         Dim object As ADODB.Parameter

     Stil = vbYesNo + vbCritical + vbDefaultButton1
        Titel = "db connection test"
    '   Meldung anzeigen.
        Antwort = MsgBox("trying to connect to db", Stil, Titel, Hilfe, Ktxt)

         ' Connect to the database using ODBC [msdaora][ORAOLEDB.Oracle]Provider=ORAOLEDB.Oracle;
         With cn
             .ConnectionString = "Provider=ORAOLEDB.Oracle;Password=pass;User ID=usr;Data Source=host:port:sid"
             .Open
             .CursorLocation = adUseClient
         End With

         ret = cn.Execute("create table newtesttable (main integer, object oid)")

         ' Here is an example if you want to issue a direct
    ' command to the database
         '
         'Set cmd = New ADODB.Command
         'With cmd
         '    .CommandText = "delete from MYTABLE"
         '    .ActiveConnection = cn
         '    .Execute
         'End With
         'Set cmd = Nothing

         '
         ' Here is an example of how insert directly into the
     ' database without using
         ' a recordset and the AddNew method
         '
         Set cmd = New ADODB.Command
         cmd.ActiveConnection = cn
         ' cmd.CommandText = "insert into newtesttable(main,object) values(?,?)"
         cmd.CommandText = "select * from test"
         cmd.CommandType = adCmdText

         ' The main parameter
        ' Set main = cmd.CreateParameter("main", adInteger, adParamInput)
         'main.Value = 100 '' a random integer value ''
         'cmd.Parameters.Append main

         ' Open the file for reading
         'fd = FreeFile
         'Open "myBlobFile.txt" For Binary Access Read As fd
         'flen = LOF(fd)
         'If flen = 0 Then
          '   Close
           '  MsgBox "Error while opening the file"
            ' End
         'End If

         ' The object parameter
         '
         ' The fourth parameter indicates the memory to allocate
     ' to store the object
       '  Set object = cmd.CreateParameter("object", _
       '                                       adLongVarBinary, _
       '                                       adParamInput, _
                                              flen + 100)
       '  ReDim chunk(1 To flen)
       '  Get fd, , chunk()

         ' Insert the object into the parameter object
       '  object.AppendChunk chunk()
       '  cmd.Parameters.Append object

         ' Now execute the command
         Set rs = cmd.Execute

     '   Mldg = "test"
        Stil = vbYesNo + vbCritical + vbDefaultButton1
        Titel = "asdasdasd"
    '   Meldung anzeigen.
        Antwort = MsgBox(rs, Stil, Titel, Hilfe, Ktxt)
         ' ... and close all
         cn.Close
         Close

 End Sub

Я полагаю, что в этом коде много проблем, но в данный момент он терпит неудачу при попытке выполнить .Open, говоря, что"Provider cannot be found. It may not be properly installed", После этого я'Я обнаружил, что мне нужно скачать и установить ORAOLEDB.dll. Я сделал это, установив ORAOledb11.dll (яЯ пробовал как 32-битные, так и 64-битные, моя машина 64-битная). Я'мы установили его, выполнив.regsvr32 OraOLEDB11.dll

К сожалению, проблема до сих пор. Итак, какие могут быть шаги для устранения этой проблемы? Могу ли я как-то убедиться, что Oraoledb правильно установлен на моей машине?

Любые советы будут с благодарностью.

Ответы на вопрос(2)

Ваш ответ на вопрос