ASP
  Home arrow ASP arrow Page 3 - ASP Database Fundamentals (Part 1)
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

ASP Database Fundamentals (Part 1)
By: Rich Smith
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 98
    2003-08-13

    Table of Contents:
  • ASP Database Fundamentals (Part 1)
  • What's All The Ado About ADO?
  • Connecting To A Database
  • Establishing The Connection
  • Closing The Connection
  • What's Next?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    ASP Database Fundamentals (Part 1) - Connecting To A Database


    (Page 3 of 6 )

    When accessing a database using ADO, the first thing you need to do is make a connection. Creating a connection to a database can sometimes be the hardest part of building an ASP application. When you create a connection object, you can reference the database one of two ways. The first way is to fully qualify the database name, the driver, and location within the connection string for the database. The second is to create a DSN (Data-source name) for the database and refer to it by name in the connection string.

    For example, connecting to an access database using a fully qualified connection string may look like this:

     <%
    ConnectionString "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" "C:\database\mydb.mdb"
    %>

    Being that information about database driver, name, and location are specified when a DSN is created in the system control panel, you only need to specify the DSN name when utilizing it. For example, to reference a DSN called "MyDB", the connection information would look like this:

     <%
    ConnectionString "DSN=MyDB"
    %>

    More ASP Articles
    More By Rich Smith


     

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek