When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Development Team Lead
Thomson Reuters (Markets) LLC
US-MA-Boston

Justtechjobs.com Post A Job | Post A Resume

Published: Monday, November 16, 1998

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:

- continued -

<%

'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!


Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article