ASP.NET
  Home arrow ASP.NET arrow Page 12 - What is ADO?
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.NET

What is ADO?
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2004-08-11

    Table of Contents:
  • What is ADO?
  • About Universal Data Access
  • Existing Technologies
  • Why ADO?
  • ADO and ADO.NET
  • Providers and Drivers
  • New Features
  • ADO 2.8
  • Examples 1-3
  • Examples 4-6
  • Language Differences
  • Creating Objects in JScript, Visual C and .NET

  • 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


    What is ADO? - Creating Objects in JScript, Visual C and .NET


    (Page 12 of 12 )

    JScript

    JScript has a syntax different from VBScript’s, although much of the object usage is similar. The major thing to watch for is that JScript is case-sensitive. For example, to create a recordset in Jscript, you would use:

    var objRs = Server.CreateObject("ADODB.Recordset");

    Use of the methods and properties is also very similar:

    objRs.CursorLocation = adUseClient;
    objRs.Open ("authors", objConn, adOpenStatic, _
                 adLockBatchOptimistic, adCmdTable);

    To loop through a recordset in Jscript, you would use:

    while (!objRs.EOF)
    {
         Response.Write (objRs(" field _ name"));
         objRs.MoveNext();
    }

    Visual C++

    To use ADO within C++, you must import the ADO library:

    #import "c:\program files\common files\system\ado\
             msado15.dll" \ 
             no_namespace \
             rename( "EOF", "adoEOF" )

    You must make sure the file path points to the location of your version of the ADO DLL. The no_namespace keyword is added so that you don’t have to scope the ADO names. The EOF property must be renamed because of an unfortunate name collision with the EOF constant defined in the Standard C library.

    Object creation follows this syntax:

    _ConnectionPtr           pConnection;
    pConnection.CreateInstance( __uuidof( Connection ) );
    _RecordsetPtr            pRecordSet;
    pRecordSet.CreateInstance( __uuidof( Recordset ) );

    .NET

    Although .NET comes with a new data access strategy (ADO.NET), You still can use ADO within .NET if required. For this you must create a .NET wrapper to use the ADO COM components. In Visual Studio .NET you can do this simply by creating a reference to the ADO component; otherwise, you can use the tlbimp.exe tool supplied with .NET to create the wrapper. See the .NET documentation for more details. Once the wrapper is created, ADO use is exactly the same as non-.NET languages.

    Summary

    So far you’ve explored the principles of data access and the range of problems created by the increasing variety and location of data and users. You’ve seen a bird’s eye view of the significance of ADO and its advantages, and briefly looked at the other data access technologies it builds on, replaces, or complements. In particular, you’ve considered:

    • Data and data stores

    • The existing technologies for accessing data, and Microsoft’s scheme to streamline data access, UDA

    • What OLE DB and ADO are, and how they tie in with each other

    • The distinction between data providers and data consumers, and Microsoft’s Distributed interNet Application Architecture framework for client/server solutions

    • The new features of ADO 2.5 and 2.6

    • The security changes introduced in ADO 2.8

    • How to use the basics of ADO in a variety of languages

    The next chapter discusses the ADO and ADOX object models.

    This is from ADO Programmer's Reference, by Dave Sussman (Apress, ISBN 1590593421). Check it out at your favorite bookstore today. Buy this book now.

     


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    ASP.NET ARTICLES

    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...





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