inicio mail me! sindicaci;ón

How to use TCP/IP to connect remote SQL server in a .asp ?

I have 2 Window 2000 servers. A server is a Web server (IIS 5.0). B server is a MS SQL 2000 database server.
 
I use the following connection string to connect successfully the B DB server from the A server.
….
cnstr = "Provider=SQLOLEDB;Persist Security Info=False;UID=xxxx;PWD=xxxx;Data Source=xxx.xxx.xxx.xxx;Initial Catalog=DDDDD;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open cnstr
……
 
But, I change the connection string to the following (it just only be added "Network=DBMSSOCN;", it is connecting with TCP/IP). It is failed !
….
cnstr = "Provider=SQLOLEDB;Persist Security Info=False;UID=xxxx;PWD=xxxx;Data Source=xxx.xxx.xxx.xxx;Initial Catalog=DDDDD;Network=DBMSSOCN;"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open cnstr
……
 
The error message is :
Microsoft OLE DB Provider for SQL Server error ‘80004005′
[DBNETLIB][ConnectionOpen (Connect()).] General network error.Check your network document
/TCPIP_Test.asp, line 14
 
Then, I use the same connection string (TCP/IP) to connect successfully the B DB server from an other C web server.
 
Other test on the A server :
1. ping -a <B server> : test OK !
2. telnet <B server> 1433 : test OK !
3. osql -U<xxxx> -S<B server> : test OK !
4. run VB6 apps with the TCP connection string : test OK !
 
What is problem in my A web server ?

 

Report Abuse

15 May 2008, 9:00 AM UTC

Ronggang Yu - MSFT

These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.

src="/IE16/images/stars1.png" />

Posts 12

Re: How to use TCP/IP to connect remote SQL server in a .asp ?

Comment

Was this post helpful ?

Reply

Quote

 

On Web server A, could you try other network methods connecting to the database server to narrow down problem?

 

NETWORK=dbnmpntw

NETWORK=dbmssocn

NETWORK=dbmsspxn

NETWORK=dbmsvinn

NETWORK=dbmsrpcn

 

Report Abuse

15 May 2008, 1:54 PM UTC

Snoopy Chen

These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.

src="/IE16/images/stars0.png" />

Posts 13

Re: How to use TCP/IP to connect remote SQL server in a .asp ?

Comment

Was this post helpful ?

Reply

Quote

Now, I have these result as followings :

 

1. use SQL OLE DB Provider with Name piping

cnstr = "Provider=SQLOLEDB;UID=xxxx;PWD=xxxx;Initial Catalog=DDDD;Data Source=xx.xx.xx.xx;Network=DBNMPNTW"
It is successfully for connecting !

 

2. use SQL OLE DB Provider with TCP/IP

cnstr = "Provider=SQLOLEDB;UID=xxxx;PWD=xxxx;Initial Catalog=DDDD;Data Source=xx.xx.xx.xx;Network=DBMSSOCN"
It is failed, and the eroor message is :

Microsoft OLE DB Provider for SQL Server error ‘80004005′
[DBNETLIB][ConnectionOpen (Connect()).] General network error.Check your network document
/TCPIP_Test.asp, line 29

 

3. use ODBC DSN with TCP/IP

cnstr = "DSN=AAAA;UID=xxxx;PWD=xxxx;"
(PS: When I create the DSN AAAA, it is OK for testing !)

It is failed, and the eroor message is :

Microsoft OLE DB Provider for ODBC Drivers error ‘80004005′
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets] General network error.Check your network document
/TCPIP_Test.asp, line 29

Report Abuse

15 May 2008, 11:36 PM UTC

Xinwei Hong - MSFT

These stars recognize your participation in the forums. For more information about the different levels of stars, and how points are earned, please see the FAQ.

src="/IE16/images/stars2.png" />

Moderator

Posts 365

Re: How to use TCP/IP to connect remote SQL server in a .asp ?

Comment

Was this post helpful ?

Reply

Quote

"Network" should be "Network Library" according to: http://msdn.microsoft.com/en-us/library/ms254500.aspx

and http://www.connectionstrings.com/?carrier=sqlserver

 

Can you try that? Thanks.

 

Bookmark:Digg Del.icio.us Reddit

Leave a Comment