My application (written in a proprietary old 4GL) is connecting to a SQL 2000 database via ODBC
This works fine nearly all the time, but occasionally, it throws the following error when trying to connect :
Connection Failed
SQLState '01000'
SQL Server Error: 10060
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]Connection Open(Connect()).
Connection Failed:
SQLState '08001'
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]SQL Server does not exist or access denied.
This error is displayed in a Windows dialog box. When the OK button on this dialog is clicked, it throws up a login/password box. When this is filled in and submitted, the connection is usually made cleanly and the application continues.
The big problem is that the application is an unattended service, and this dialog can go unnoticed for quite a while.
If these dialogs are 'Cancelled' rather than 'OK'd, the 4GL receives the error and arranges to re-try the connection itself.
Is ODBC responsible for popping up the interactive dialog, and, if so, can I do anything to force it to return an error instead ?
Hi Steve,
Interesting situation. The error 10060 means this: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. So you are probably experiencing a timeout in one of the socket-relation ops, most probably connect() (different from the SQL netlib's Connect() mentioned above).
The login popup is implemented by the SQL ODBC driver. You are probably using SQLDriverConnect in ODBC? It has a parameter "DriverCompletion", which could be:
SQL_DRIVER_PROMPT
SQL_DRIVER_COMPLETE
SQL_DRIVER_COMPLETE_REQUIRED
SQL_DRIVER_NOPROMPT
You probably have passed the first one (SQL_DRIVER_PROMPT). In order to make sure the SQLDriverConnect fails without popping up the troublesome dialog, you need to pass the SQL_DRIVER_NOPROMPT. I truly hope you are able to modify the 4GL application?
HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks a lot Jivko.
Unfortunately, the only parameter the 4GL allows me to specify is the DSN name.
I'll be on to the vendor's support desk rather forcefully first thing on Monday morning - thanks for the Ammo!
No comments:
Post a Comment