Customer Portal Language
 
Home Knowledge Base ASP Com Objects DSNLess database connection for access databases
Information
Article ID7
Created On5/25/2008
Modified5/25/2008
DSNLess database connection for access databases

First thing you have to do is have the physical pat on the server. For our servers this path is:

C:\Domains\myWebSite.com

DSNless connections are easy to produce and can be kept with your scripts. This also allows you to have as many different databases on one website. Your databases are store in the 'db' directory. This directory was created when your website was created and has all the necessary permissions for connection. Your physical path will C:\Domains\myWebSite.com\db . Now for the connect string to access the database.

DSNless = "DRIVER={Microsoft Access Driver (*.mdb) _ ;UID=;PWD=;DBQ=C:\Domains\myWebSite\db\mydb.mdb"

The first part of the string is your ODBC connection string Driver. Next is the UID. You should never have to enter anything for it to equal, but do include it in your statement. PWD is your database password. This you can set inside access by opening the database in the exclusive mode. Click on tools, Security and then click on "Set database password" make sure it's something you can remember because once its set you will need it anytime you want to open it. Ex.: PWD=mypassword.

The last piece is the DBQ. This is where you have to place the physical path to the database. See example above.