here's an example from
http://www.able-consulting.com/ADO_Conn.htm
oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
Where:
- "Network Library=DBMSSOCN" tells OLE DB to use TCP/IP rather than Named Pipes
- xxx.xxx.xxx.xxx is an IP address
- 1433 is the default port number for SQL Server.
- You can also add "Encrypt=yes" for encryption
hth
Phil