Hi

I am trying to access a database that is going to be located on a remote server, but i have no idea how to do it.

i tried this commands so far but they don't work:

Dim oSqlConn As New SqlConnection

oSqlConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

oSqlConn.Open()

Can anybody point me in the right direction please?

Thanks in advance

Hi

I am trying to access a database that is going to be located on a remote server, but i have no idea how to do it.

i tried this commands so far but they don't work:

Dim oSqlConn As New SqlConnection

oSqlConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=mySQLServerDBName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

oSqlConn.Open()

Can anybody point me in the right direction please?

Thanks in advance

Your data source syntax looks correct to me. You may refer to the wonderful Connection Strings dot com for more syntax advice.

I think your problem lies elsewhere. If you have local access to the server your script runs on, you can use the Data Sources control panel (Control Panel -> Administrative Tools -> Data Sources) to try to create a System DSN to the server, just to see if it can connect. Could be a networking problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.