MSSQL Connection String Example

MaxPower

Perch
I'm trying to connect to a MSSQL database on another server (host) so I have to use a connection string. Below is what I'm trying to use. Is this format correct?

ConnectionString = "DRIVER=SQL Server;SERVER=ipaddress;UID=userid;PWD=password;APP=;DATABASE=database"

Of course, the ipaddress, userid, password and database are replaced with my actual information.

I get the following error:

ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.


Thanks, Gary
 
A space was added when the text was pasted. It is actually: APP=; and I have no idea what it means. Deleting it didn't help.
 
I've tried several strings from connectionstrings.com but I'm just taking shots in the dark. I'll contact tech support.
 
I was using Dreamweaver to create the connection code and it must have caused a syntax problem. I entered the code on the page myself and it now appears to work. Here's the connection string I eventually used:

dbConn_Settings = "Driver=SQL Server;Server=ipaddress;Port=1433;Database=dbname;UID=username;PWD=password;"
 
I had issues with above when connecting via dreamweaver for local binding etc. I found the solution that worked to enable local table view and binding at http://connectionstrings.com/Articles/Show/define-sql-server-network-protocol
Check out connection via IP. However their string hasn't got Provider=SQLOLEDB.1; at the beginning of the syntax, which I needed to make connection.
Then When uploading to production, I ammended the str to use db server nameservers. Hope that helps if youre having grief.
 
Back
Top