Error connecting to Sybase from VBScript - internal client library error

I write VBScript that connects to the Sybase database, reads some data from the table and saves it in variables, then connects to the MS SQL server and inserts the data into the tables with the variable data that were saved earlier.

I'm not sure if this is relevant information, but since I only have a 32-bit driver to connect to Sybase ODBC, and since this VBScript runs on a 64-bit machine, I run it through the command line, but using SysWoW64 cmd.exe and run it as follows:

C:\Windows\SysWOW64>cscript C:\My\Directory\MyVBScript.vbs 

I'm having trouble connecting to the Sybase database. Initially, I had some problems with the connection string itself, but this seems to have been parsed.

Here is the error message that I am getting now, but I have no idea how to get past this:

Microsoft OLE DB provider for ODBC drivers: [SYBASE] [ODBC Sybase driver] [Sybase] ct_connect (): user level api: internal client library Error: HAFAILOVER: attempt to connect to the server


Here's the script, as of now,

 Dim connStr, objConn DataSource = "ICCM_PREVIEW" ServerIP = "1.2.3.4" Port = "1234" DBuser = "myUser" DBpwd = "myPassword" DBName = "myDatabase" Driver = "SYBASE ASE ODBC Driver" connStr = "" connStr = connStr &"Driver="& Driver &";" connStr = connStr &"Data Source="& DataSource &";" connStr = connStr &"Srvr="& ServerIP &","& Port &";" connStr = connStr &"Database="& DBName &";" connStr = connStr &"uid="& DBuser &";" connStr = connStr &"pwd="& DBpwd &";" Wscript.Echo connStr 'Define object type Set objConn = CreateObject("ADODB.Connection") 'Open Connection objConn.open connStr 

What am I missing here?

+8
sybase vbscript connection-string
source share
1 answer

The Srvr parameter is not a valid connection parameter, and a Port key-value pair is required.

Before

 connStr = connStr &"Srvr="& ServerIP &","& Port &";" 

After

 connStr = connStr &"Server="& ServerIP & ";" connStr = connStr &"Port="& Port &";" 

Excerpt from Microsoft Website

enter image description here

Connection Parameters Diagram

The following is a list of connection parameters other than the DSN parameter that can be provided to the ASE ODBC driver

Excerpt from User Guide for Sybase Adaptive Server Enterprise ODBC Driver

enter image description hereenter image description hereenter image description hereenter image description hereenter image description here

+4
source share

All Articles