Kelowna web design and hosting

Kelowna web design and web hosting company 1-250-870-3393

Web site updated: 07/26/2007
About us
Web design portfolio

Mission statement
Testimonials
Careers
Contact us
Sitemap

Our services
Kelowna web design

Search engine marketing
Database design
Kelowna web hosting
Support

Free web design tutorials
HTML tutorials
Javascript tutorials
ASP tutorials
Website marketing
Search engine marketing
Flash tutorials

Free web design articles
Web design
Internet business
Computer programming
Advertising & internet marketing
Search engine marketing
Small business startup
Web hosting
Computer hardware

Web designer resources
Kelowna web mail
DNS lookup tool
E-Books
Tutorial XML feeds
Article XML feeds
Search engine marketing Tools


Web Design Tutorials ASP web site design tutorial Database Connection

Database Connection Strings


Database Connection Strings Learn how to connect to different kinds of databases in ASP.

Although our ASP database tutorials all use MS Access connection strings, there are many sorts of database software out there for use with ASP. This tutorial will show you how to connect with them.

MS ACCESS

First, we'll take a look at the regular MS Access Connection String:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; DBQ=" _
& Server.Mappath("db/users1.mdb") & "User ID=Administrator;Password=rev01t;"
Conn.Open



Some people have trouble with this string, so I decided to add another connection string in its place:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.connectionstring = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" _
& Server.Mappath("db/users1.mdb") & ";User Id=Administrator;Password=rev01t;"
Conn.Open


One of these two should work out for you, where the Password is the database password, or a combination of the User ID and the Password are given to restrict access to a certain table. Note: if you have no username or password, erase everything after the third to last ';' like so:

& Server.Mappath("db/users1.mdb") & ";"


MS SQL

This is a less common alternative to Access databases, most commonly used by large scale websites. Here's our connectionstring to SQL:


set Conn = server.createobject("ADODB.Connection")
Conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=servername;User ID=username;_
Password=password;DATABASE=databasename;"


There's your MS SQL string. Be sure to change servername to the name of the server (localhost, computername, or IP), and to change username, password, and databasename to match those of your database.

Rate This Material: Bad 1 2 3 4 5 Excellent
 




Kelowna web design and web hosting
© 2010 www.kagemedia.com
Kelowna web design and development | Kelowna web hosting
Kelowna website marketing | Kelowna database design | Links

Serving:
Kelowna BC - Penticton BC - Vernon BC - Westbank BC - Winfield BC

FREE web design and hosting package.
Win a FREE web design!
We are giving away a completely free web design and web hosting package every month.

Click here for details