1

the operating system is windows 10 64bit

I have configured on c:\windows\syswow64\odbcad32 the new user DSN using driver Oracle in instantclient_11_2 for connect remote Oracle database

enter image description here

the connection is successfull

enter image description here

now i tried connection on VBscript file but the return is an error

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified.

how to do resolve this?

   Set cn = CreateObject("ADODB.Connection")  
   cn.Open "Driver={Oracle in instantclient_11_2}; " & _
           "CONNECTSTRING=(DESCRIPTION=" & _
           "(ADDRESS=(PROTOCOL=TCP)" & _
           "(HOST=XXX)(PORT=1521))" & _
           "(CONNECT_DATA=(SERVICE_NAME=XXX))); uid=XXX;pwd=XX;"
  
   cn.CommandTimeout = 10000
   
   cn.Close()
   Set cn = Nothing  
  • 1
    Are running `wscript.exe` or `cscript.exe` in 32-bit mode, i.e `%systemroot%\SysWOW64\wscript.exe`? If you just call `wscript.exe` it will default to the 64-bit version. – user692942 Aug 18 '20 at 14:18

1 Answers1

-1

Setting up an Oracle ODBC Driver and Data Source

Last version 64-bit ODAC 12.2c Release 1 (12.2.0.1.1) for Windows x64

Oracle in OraClient11g_home1 connection strings

   Set cn = CreateObject("ADODB.Connection")  
   cn.Open "Driver={Oracle in OraClient12home1}; " & _
           "CONNECTSTRING=(DESCRIPTION=" & _
           "(ADDRESS=(PROTOCOL=TCP)" & _
           "(HOST=XXX)(PORT=1521))" & _
           "(CONNECT_DATA=(SERVICE_NAME=XXX))); uid=XXX;pwd=XX;"
  
   cn.CommandTimeout = 10000
   
   cn.Close()
   Set cn = Nothing  
Hamamelis
  • 1,983
  • 8
  • 27
  • 41
  • I'm not sure how any of this answers the question, the OP has explained they setup their DSN using the correct architecture version of `odbcad32.exe`, so their issue isn't the connection. Maybe you are suggesting not using a DSN and hard coding the connection, but that doesn't explain why they can't access the DSN. – user692942 Aug 18 '20 at 16:43
  • Thank you so much mr Hamamelis, now working! –  Aug 19 '20 at 13:26