ASP
  Home arrow ASP arrow Page 4 - 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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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: 5 stars5 stars5 stars5 stars5 stars / 97
    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) - Establishing The Connection


    (Page 4 of 6 )

    ADO is an object-oriented programming interface. In layman's terms, this means you will be working with different "objects" in order to communicate with the database. The first of these objects you will work with is the Connection Object.

    Lets take a look at a code sample that creates a database connection object:

     <%
    ConnectionString "DSN=MyDB"

    set conn server.createobject("adodb.connection")
    conn.open ConnectionString
    %>

    In the above example, you can see that we create an object called "conn", which is defined as an ADO connection. Once we have an object for the connection, we attempt to open that connection using the open method of the object.

    One thing I'd like to mention here is you will see that I am referencing the "connection" object of the "adodb" class in my createobject method. By default that statement will fail, since IIS does not know that that object is or how to make it. There are two ways to make this information known to IIS.

    The first is to create an object reference to the ADO library inside your GLOBAL.ASA file. See my article on the GLOBAL.ASA to see how this is done.

    Secondly, you can use the ADOVBS.INC module. This is an include file that comes with IIS, that you can include in any ASP page. It contains the appropriate declarations to be able to used the ADO objects within your code.

    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

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT