Computers & Technology Library

Various Connection Strings to Connect to an Access DB

By John Hutchison

If you want to call a database from within an asp page the that is to tell your asp page where your database is. Here are a few samples of database connection strings that could be used to help you connect to your database I have also indicated where the code starts and finishes.

OLE DB Method for SQL

'code start 'code finish

DSN-Less connection for Access

'code start 'code finish

OLE DB Method for Access

'code start 'code finish

File DSN Connection Method for Access

'code start 'code finish

Don't forget when you download an application this info should be included. Remember to RENAME the database as others can download the application from where you did and see what the default name is if your page is live ie on the web and you have not renamed the database they could easily download your database and add or change information contained in the database. I had this happen a few years ago and all the links pointed to porn sites luckily I did not have many visitors in those days. So remember change the database name and possibly the directory that the database is in.

About the Author

John Hutchison
This article can be found at http://www.searchhuts.co.uk/portal/articles/activenews_view.asp?articleID=12

Copyright © 2006, CompTechLib.com