Hi, My SQL Anywhere 10 database is running as a service on Win server 2003. And I am using a DSN in a connection string to connect to this database from my application. When setting up this DSN, I must check "TCP/IP" under "Network" tab to connect to this database server because it is running as a service. When I try to connect to database from my application, it throws error "Unable to initialize requested communication links" and fails to connect to database. Please help. Thanks, Vijay |
What have you tried? If you test the connection DSN via the ODBC administrator, does it connect successfully? Can you use the DBPING utility to get to the server without error?
Yes, connection DSN connects successfully via the ODBC administrator. I can also also ping the server using DBPING utility using the same connection string ('DSN=TestBank'). But when I connect in my application with following SQL code, it generates above error message.
EXEC SQL CONNECT USING 'DSN=TestBank';
FYI, my application is an old app and was compiled with SQLA 6. But the same application can connect successfully on a couple of other servers.
Thanks, Vijay
So you have an ESQL application using SQL Anywhere 6 DBLib. FYI, version 6 hasn't been supported for many years.
Try setting the SQLCONNECT environment variable to
DEBUG=YES;LOGFILE=c:\temp\cli.out
(or whatever local file you want). Then rerun your app (it should fail to connect again) and take a look a the local file (cli.out). It may give some clues to why this is failing. If you don't see anything obvious, post the file here.I created the log file as per your suggestion and it contains "TCPIP communication link not started" message. That is precisly the issue on this machine. The strange thing is that the same app can connect successfully to database using TCPIP on other machines. What the app is missing on this machine to start TCPIP communication to database ? Following is the log file dump:
Mon Feb 27 2012 12:12 Trying to start Shared Memory link ...
CONN: Attempting to connect without default DSN using: UID=dba;PWD=***;DBN=OnCallTest;ENG=OnCall;ASTOP=YES;DSN=TestBank;INT=NO;DBG=YES;LOG=C:tempSQLA.log;DMRF=NO;LINKS=TCPIP{} CONN: Attempting to connect with default DSN using: UID=dba;PWD=***;DBN=OnCallTest;ENG=OnCall;ASTOP=YES;DSN=TestBank;INT=NO;DBG=YES;LOG=C:tempSQLA.log;DMRF=NO;LINKS=TCPIP{} CONN: Starting remote ports Trying to start TCPIP link ...
TCPIP communication link not started