MS Access :: Do you have sample connection strings for DSN Less Connection and DSN Based Connection?

MS-Access Database Connection ASP code:

DSN Less Connection:

Dim strConn
Set strConn = Server.CreateObject("ADODB.Connection")
strConn="DRIVER={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & "DBQ=" & Server.mappath
("db/mydb.mdb")

-OR-

strConn=strConn & "DBQ=C:\domains\mydomain.com\db\mydb.db"

DSN Based Connection:

Dim strConn
Set strConn = Server.CreateObject("ADODB.Connection")
strConn.ConnectionString = "DSN=test"
strConn.Open

Response.Write "Access Connection Successful"
  • 0 Users Found This Useful

Was this answer helpful?


Related Articles

How do I place my database on your server? Will my primary keys, stored procedures and constraints be preserved or destroyed?

All you have to do is to take a full backup of your database on your local machine and place a...

Where is the database folder for MS-Access database?

'db' folder created along with the 'www' or 'wwwroot' folder is the recommended folder for .mdb...

Can I connect to MSSQL server on two machines with the same user?

Yes, you can. But in that case, you will need to have both your PC on different network. It won't...

My website is working but unable to fetch the data from MySQL database

There are many reasons due to which you are unable to fetch the data from your MySQL database....