Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

vbscript to connect to oracle fails with ORA-12560: TNS:protocol adapter error

User484453-OCNov 13 2013 — edited Nov 15 2013

I am running a Windows 7, 64 bit system with the Oracle 32 bit client installed.  The 32 bit client is required for use with Oracle's Documaker Studio which is working fine with the current client configuration.  I would like to connect the same database using a vbscript.  Here is the test script I am using:

Option Explicit

Dim strCon
strCon = "Driver={Oracle in OraClient11g_home1_32bit}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
         "(HOST={VSTODEEDATxx.xxxxxxx.com})(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=IDMAKER))); uid=xxxxxx;pwd=xxxxxxxx;"

Dim oCon: Set oCon = WScript.CreateObject("ADODB.Connection")
Dim oRs: Set oRs = WScript.CreateObject("ADODB.Recordset")
oCon.Open strCon
Set oRs = oCon.Execute("SELECT TO_CHAR(SYSDATE,'MM-DD-YYYY HH24:MI:SS') AS DateTime FROM DUA")
While Not oRs.EOF
    WSCript.Echo oRs.Fields(0).Value
    oRs.MoveNext
Wend
oCon.Close
Set oRs = Nothing
Set oCon = Nothing

In the connection string I am using the 32 bit driver used succesfully by Documaker.  I provided all the parms to eliminate the need for tnsnames.ora.  However, I do have tnsnames.ora on my system and Documaker is using it.

Since the client is 32 bit, I am using the following command to run the script:

c:\windows\syswow64\cscript.exe c:\temp\oracle\testing\testconnect.vbs

This is suppose to run the script in 32 bit mode and be compatible with the client.

When I run the program I get the following error:

Microsoft (R) Windows Script Host Version 5.8

Copyright (C) Microsoft Corporation. All rights reserved.

c:\temp\oracle\testing\testconnect.vbs(12, 1) Microsoft OLE DB Provider for ODBC

Drivers: [Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error

Would someone please advise on how to debug this problem?  Thanks, Gary

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2013
Added on Nov 13 2013
1 comment
6,240 views