Knowledgebase: ASP .NET / ASP
ADO Connection String
Posted by on 09 March 2011 04:33 PM

For Microsoft Access Data Projects ( adp files ) or other ADO connections from clients (remote and local):

ADO Connection string

sCONN = "Provider=SQLOLEDB.1;Data\SQLEXPRESS,1433;Initial Catalog=database_name;User ID=user_name;Password=password"

The key is that the port has to be added to the end of the server name. And can be interchangeable with 'localhost' when using this locally.


For clients signed up after April 5th, 2012, the instance name for your server is most likely not "SQLEXPRESS". Instead, it is "MSSQLSERVER":

sCONN = "Provider=SQLOLEDB.1;Data\MSSQLSERVER,1433;Initial Catalog=database_name;User ID=user_name;Password=password"


In some cases, the instance name may need to be excluded like this:

sCONN = "Provider=SQLOLEDB.1;Data,1433;Initial Catalog=database_name;User ID=user_name;Password=password"

(7 vote(s))
Not helpful

Comments (8)
Stephen Heid
18 July 2011 01:16 PM
How about a connection string to connect to an excel file (.xls or .xlsm)? Would the provider be "Microsoft.ACE.12.0"?
Arvand Sabetian
25 July 2011 08:59 AM
I am not quite sure of that. I would turn on detailed errors and use providers that you feel may work. Please note that as our systems are 64-bit windows, some providers which were only created in 32-bit environments may not work as expected.
Rob Hopper
07 October 2011 05:37 PM
That probably should be enough, but my asp is fairly novice. Here is the code I was using with my previous provider. If possible, can you tell me how I should modify it for arvixe?

Set adoCon = Server.CreateObject ("ADODB.Connection")
Set objRec = Server.CreateObject ("ADODB.Recordset")

adoCon.Open = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("databases/reviews.mdb")
Ryan C
18 October 2011 07:07 AM
If you take sCONN = "Provider=SQLOLEDB.1;Data\SQLEXPRESS,1433;Initial Catalog=database_name;User ID=user_name;Password=password"

and compare that to filling:

adoCon.Open = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("databases/reviews.mdb")

It is likely going to be as simple as in our variables and replacing everything after the equals. That being said, I'm not 100% sure. I can only advise using our example and providing it to your developer in order to have him check it to be sure. If you run into any errors, turning on detailed errors may assist as well.
04 March 2013 01:10 AM
What is the connection string to connect to sqlserver2008 database of arvixe server from my project?
Michael Carr
06 March 2013 10:08 AM
The complete string will depend on the configuration of your database. The database name, database user and that users password will all be unique to your site. I would suggest opening a support ticket if you need help getting the connection string created.
15 July 2013 10:18 AM

What is the connection string to connect to a postgresql database 7.4.5 ???
Michael Carr
16 July 2013 01:04 PM
This would depend on the the database name, user name and password. Please open a support ticket and we will be glad to assist with that.
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).