ASP
  Home arrow ASP arrow Page 2 - ADO for the Beginner
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

ADO for the Beginner
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2007-11-12

    Table of Contents:
  • ADO for the Beginner
  • Connecting to a Database
  • Connect to a Database with ODBC
  • Working with Table Recordsets
  • How to Display Data

  • 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


    ADO for the Beginner - Connecting to a Database


    (Page 2 of 5 )

    Before you can work with the data inside of a database you must first connect to a database. There several ways to do this:

    How to Create a DSN-free Connection

    Of the two ways to connect to a database, the DNS-free way is probably the easiest. It can be used to connect to any Microsoft Access database. For our example let's say you have a database named ChuckNorrisVictims.mdb that is located on a web directory such as "  c:/webinfo/  ". To connect to the ChuckNorrisVictims database, you could use the following code:


    <%

    set conn=Server.CreateObject("ADODB.Connection")

    conn.Provider="Microsoft.Jet.OLEDB.4.0"

    conn.Open "  c:/webinfo/ChuckNorrisVictims.mdb  "

    %>

    As you can see from the above code, you must include the database driver (Microsoft.Jet) and the path to your database.

    More ASP Articles
    More By James Payne


       · Heyo! Welcome to my article on Beginning ADO. Here we discuss such topics as:...
     

    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 1 Hosted by Hostway
    Stay green...Green IT