trimbandit
10-21-2004, 05:34 PM
Hi,
I had some code that connected to a SQL server. The server was brought down and our database was moved to a new server. The problem is that the server does not use the default SQL port. I can connect through enterprise manager, but I had to pop a reg key to point to the correct port. How can I specify the port to use in me code, which I've pasted below? Any help is appreciated. My boss is really on me to get this fixed.
Thanks,
CMG
Global SQLCON As New ADODB.Connection
Public Function SQLConnect() As Boolean
SQLCON.ConnectionTimeout = 25
SQLCON.Provider = "sqloledb"
SQLCON.Properties("Network Address").Value = "3.10.202.15"
SQLCON.CommandTimeout = 180 ' set timeout for 3 minutes
SQLCON.Properties("Network Library").Value = "dbmssocn"
SQLCON.Properties("Data Source").Value = "SERVER"
SQLCON.Properties("Initial Catalog").Value = "BW_CONFIG"
SQLCON.CursorLocation = adUseServer ' For ADO cursor location
SQLCON.Properties("User ID").Value = "BW_DBO"
SQLCON.Properties("Password").Value = "w0rkstations"
SQLCON.Open
I had some code that connected to a SQL server. The server was brought down and our database was moved to a new server. The problem is that the server does not use the default SQL port. I can connect through enterprise manager, but I had to pop a reg key to point to the correct port. How can I specify the port to use in me code, which I've pasted below? Any help is appreciated. My boss is really on me to get this fixed.
Thanks,
CMG
Global SQLCON As New ADODB.Connection
Public Function SQLConnect() As Boolean
SQLCON.ConnectionTimeout = 25
SQLCON.Provider = "sqloledb"
SQLCON.Properties("Network Address").Value = "3.10.202.15"
SQLCON.CommandTimeout = 180 ' set timeout for 3 minutes
SQLCON.Properties("Network Library").Value = "dbmssocn"
SQLCON.Properties("Data Source").Value = "SERVER"
SQLCON.Properties("Initial Catalog").Value = "BW_CONFIG"
SQLCON.CursorLocation = adUseServer ' For ADO cursor location
SQLCON.Properties("User ID").Value = "BW_DBO"
SQLCON.Properties("Password").Value = "w0rkstations"
SQLCON.Open