Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Trying to connect to Oracle DB

$
0
0

I have encountered a need to connect to an Oracle db, and am not having much luck. I have read through a number of posts on the forum, with several different ways of doing it, but seem to be getting an error either way. I have a DSN set up, and can manually (successfully) test the connection, but something I am doing in the script does not seem to work. I would appreciate any suggestions, as this is not my forte.

 

Info:
Machine has Oracle 11g installed (Oracle in OraClient11g_home1)

 

A couple methods I have tried:

 

For this one, I have tried the full driver string, as well as just OraClient11g_home1. The error returned from my error handler is "Data source name not found and no default driver specified"

  1. $conn = ObjCreate( "ADODB.Connection" )
  2.  
  3. $DSN = "Driver={Oracle in OraClient11g_home1}; " & _
  4.  "CONNECTSTRING=(DESCRIPTION=" & _
  5.  "(ADDRESS=(PROTOCOL=TCP)" & _
  6.  "(HOST=10.10.204.87)(PORT=1521))" & _
  7.  "(CONNECT_DATA=(SERVICE_NAME=123prod)));uid=admin;pwd=Admin123;"
  8. $conn.Open($DSN)

For this one, I tried both the Oracle 11g above, and Microsoft ODBC for Oracle. I get a different error for Microsoft ODBC for Oracle: "Driver's SQLSetConnectAttr failed"

  1. Global $adoCn = ObjCreate( "ADODB.Connection" )
  2. $adoCn.Properties("Prompt") = 1; 1=PromptAlways, 2=PromptComplete
  3. $Txt = "DRIVER={Oracle in OraClient11g_home1};SERVER=ARTHUR;DBQ=123PROD;UID=admin;PWD=Admin123;"
  4.         $adoCn.ConnectionString = $Txt
  5.         $adoCn.Open

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>