Friday, March 9, 2012

ODBC tries to connect through the wrong port

Hi,

I've been running some tests with a 3rd party application during the last few days, but the ODBC doesn′t seem to be working well.

The ODBCs are configured to go through specific ports, since there's a firewall between the server (production area) and the database (which is located in the dev area). If i press the TEST CONFIGURATION button after i configured the ODBCs, the test is successful, and the log file of the firewall monitor shows that the server is connecting through the designated ports.

But when i run the 3rd party application, the queries fail, showing an error that says "The server cannot be found or you don′t have access", after this error, another one appears, saying something like "Connection().opened..." - unfortunately I don't have the actual text, I'll try to post it as soon as i get them .

Just to make sure that the 3rd party app is doing its job, dev team wrote a simple VB6 app to query the database, and it shows the same error.

Both apps are running well in the dev environment, since dev machines don't have to go through the firewall, and both apps are using the ODBC configured in the same way as the server. I could think that the problem is the firewall, but the firewall logs show that the production server is trying to use ports 1433, 1434, 445 and 139, and there isn′t a single entry showing activity for the ports specified on the ODBCs configuration.

The database server is running SQL Server 2000, the dev pcs are running Windows 2000, and the ODBC driver version is 2000.85.1117.00.

On the Production environment the server that is trying to access the database is running Windows 2003 Server Ent Ed. SP 1 , and the ODBC driver version is 2000.86.1830.00

I hope some one outthere has any ideas to solve this problem, or at least any idea of what is causing this error, because i′m running out of them.

Thanks in advance.

Efrain Morales

The error messages are:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. 424 [Microsoft][ODBC SQL Server Driver]SQL Server does not exist or access denied.

After this one, it appears another window saying:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). 424 [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen(Connect())

I hope this helps, thank you

|||

Hi Efrain,

Are you trying to connect to a named instance? That would explain the 1434 UDP port activity - the client is looking for a SQL Browser / Listener service which to "resolve" the named instance to a port. Or do you have a default instance with a modified non-1433 TCP) port?

When you mention using the ODBC Administrator (where it works), are you by chance clicking the "Client Configuration" button and providing a non-dynamic port? What this does is to create an alias with the name of the server and specify the port. Depending on the client application, the alias might not be taken into account, especially if it is with the same name as the server or if this is a named instance.

What you could try is to create an alias with cliconfg.exe and name it differently, for instance <servername>_alias and fix the port. Then modify your connection string or ODBC DSN to use the alias without specifying the client configuration and see if this helps.

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment