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?
sybase vbscript connection-string
Armin
source share