ezarticlelist.com
   Index Page -> About Us -> Privacy of Info -> Terms of Use -> Add Url -> Add Article
Search:   
   

Home & Garden

   

People & Communities

   

Self Enhancement

   

Automotive

   

Property & Agents

   

Adventure & Sports

   

Business & Services

   

Recreation & Entertainment

   

Law & Politics

   

Finance & Banking

   

Indoor Games

   

Children

   

Academics & Learning

   

Hygiene & Health

   

Medicine & Treatment

   

Science & Research

   

Online Shopping

   

Jobs & Employment

   

News & Media

   

Eating & Drinking

   

Computers & Networking

   

Culture & Art

   

Tour & Travel

   

Relationship & Lifestyle

 

Index Page » Computers & Networking » PC Resources
 

Various Connection Strings to Connect to an Access DB

 

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. I have used [] as the normal < > makes it impossible to see the code in the finished article as the page thinks it is real code so does not display it. If you want to use any of the code remember to change the square brackes [] to <>

OLE DB Method for SQL

'code start
[% set cnn = server.createobject("ADODB.Connection") cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=dbname.mdb " %]
'code finish

DSN-Less connection for Access

'code start
[% set cnn = server.createobject("ADODB.Connection") cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:yourdatabase.mdb" %]
'code finish

OLE DB Method for Access

'code start
[% set cnn = server.createobject("ADODB.Connection") cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=c:yourdatabase.mdb" %]
'code finish

File DSN Connection Method for Access

'code start
[% set cnn = server.createobject("ADODB.Connection") cnn.open "FILEDSN=AccessDSN" %]
'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.

Author: John Hutchison
 
Author Bio:
John Hutchison is a reputable writer. John likes to scribble articles about this industry.
 
 
 

Related Articles

 
Getting a Job Writing Website Content?10 SEO Tips for Creating a Sample Web Page
 
Manual Vs Automated Submission! Which One Is The Best?
 
TIP: Don't Forget About Your Power Supply
 
How to Switch to Firefox and Why You should
 
How to Pick Keywords That Will Deliver Hot Targeted Traffic for Free
 
Shared Hosting
 
Hosting Your Way All The Way To The Bank
 
How To Advertise Using The World's Most Expensive Ad - And Pay Only One Dollar For It
 
Why are People Buying Shoes Online? Let Me Count the Ways
 
Increasing Web Site Traffic to Your Web Site
 
 
 
Index Page -> Privacy of Info -> Terms of Use  
Copyright © www.ezarticlelist.com - All Rights Reserved Worldwide.