VB to SQL2000 Connection String Error 
Author Message
 VB to SQL2000 Connection String Error

Is it possible to connect to an SQL server using an IP
address, instead of the server name?
This is my connection string:
CONNECTION_STRING = "Provider=SQLOLEDB; Driver={SQL
Server}; Server=<ip address> Database=<db name>; UID=<user
id>; PWD=<password>"

It works fine if I use the server name, but if I use an IP
address I get the following error:
"Invalid Connection String Attribute"
-2147467259

I am using VB6 SP4 and MDAC 2.6



Sat, 07 Feb 2004 00:00:13 GMT  
 VB to SQL2000 Connection String Error
You need to set the Network Library to TCPIP in order to do this. You can do
this in your connection string.
Check out this link:
<http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForSQLServer>

Bob Barrows


Quote:
> Is it possible to connect to an SQL server using an IP
> address, instead of the server name?
> This is my connection string:
> CONNECTION_STRING = "Provider=SQLOLEDB; Driver={SQL
> Server}; Server=<ip address> Database=<db name>; UID=<user
> id>; PWD=<password>"

> It works fine if I use the server name, but if I use an IP
> address I get the following error:
> "Invalid Connection String Attribute"
> -2147467259

> I am using VB6 SP4 and MDAC 2.6



Sat, 07 Feb 2004 00:23:22 GMT  
 VB to SQL2000 Connection String Error
You are specifying both an OLEDB provider and an ODBC driver in your
connection string; you should use only one. Try the following syntax
instead:

"provider=sqloledb;data source=<ip address>;initial catalog=<db name>;user
id=<userid>;password=<pwd>;network library=dbmssocn;"

That last parameter, Network Library, forces OLEDB to use TCP/IP to
communicate with the server. In order for this to work, the server needs to
be set up to listen for TCP/IP requests, which I'll assume has already been
done. It's the default on later versions of SQL Server.

Hope this helps!

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData



Sat, 07 Feb 2004 06:07:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB to SQL2000 Connection Strin Error

2. VB6 - CR8.5 > SQL2000 ole connection problem

3. Using SQL2000, returning an XML document (string) instead of a recordset, from a stored procedure

4. connection string.open error

5. open connection string error

6. Why ISAM error using Access and unbound ADO controls with sql string connection

7. error using connection string w/ access db

8. Change ADO Control connection string at runtime (error)

9. Invalid Connection String Attribute error

10. ADODB Connection String- Two Diff Examples - Two Diff Errors

11. SQL2000 error description problem

12. MS SQL connection string for remote internet connection?

 

 
Powered by phpBB® Forum Software