-
January 9th, 2002, 12:37 AM
#1
How To Specify MS -SQL Server port number in Connection String
Hi,
I am trying to establish a connection with MS SQL server database. To do this I form a Connection String. In the connection String I specify the Database server name, User name and Password. Till this it is fine.
But my problem is I also want to specify the port number. by default it is 1433 for SQL Server, but what if SQL Server is running on some other port number. Then how do I specify this port number in Connection String?
Thanks,
Dipesh
-
January 9th, 2002, 12:57 AM
#2
Re: How To Specify MS -SQL Server port number in Connection String
http://www.able-consulting.com/ADO_Conn.htm
To connect to SQL Server running on a remote computer (via an IP address):
oConn.Open "Driver={SQL Server};" & _
"Server=xxx.xxx.xxx.xxx;" & _
"Address=xxx.xxx.xxx.xxx,1433;" & _
"Network=DBMSSOCN;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
Where:
- xxx.xxx.xxx.xxx is an IP address
- 1433 is the default port number for SQL Server.
- "Network=DBMSSOCN" tells ODBC to use TCP/IP rather than Named Pipes (Q238949)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|