To read the article online, visit

Connecting to a Database

If you want to connect to a database, there are several ways you can do it using ASP. I suggest using a DSN on your server, although you can use a connection string if you like. Let's assume you have a System DSN on your server named "MyDatabase", which points to an Access database. Here is what you could write in your ASP page to connect to the database:


'Create a connection to the database
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
'Open the connection
Conn.Open "MyDatabase"

That's all there is to connecting to a database. You can now query the database, update records, delete records, etc.

Happy Programming!

Article Information
Article Title: Connecting to a Database using ASP
Article Author: Scott Mitchell
Published Date: Monday, November 16, 1998
Article URL:

Copyright 2018 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers