ASP
  Home arrow ASP arrow Page 6 - ASP Database Fundamentals (Part 4)
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 4)
By: Rich Smith
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 81
    2003-10-27

    Table of Contents:
  • ASP Database Fundamentals (Part 4)
  • Updating Existing Records
  • Updating Records with the Recordset Object
  • The Update Method in More Detail
  • But What if I Goof?
  • Updating Using the Connection Object
  • Deleting Information
  • Deleting Using the Connection Object
  • Where Do We Go From Here?

  • 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 4) - Updating Using the Connection Object


    (Page 6 of 9 )

    As illustrated when we discussed inserting records into the database, the execute method of the connection object can be used to execute a correctly constructed SQL statement. By using this method, you can quickly and easily update database records without the need or overhead of creating a recordset object.

    For example:


    <%

    ConnectionString "DSN=MyDB”

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

    mySql = “Update Customers set Status = ‘Active’, “ & _
             “Profile = ‘Visible’ where CustomerNo = 10”

    conn.execute mySql

    conn.close
    set conn = nothing
    %>



    Again, this method can be considered a little more daunting than using the recordset object, because it requires at minimum a fundamental knowledge of SQL. It is, however, one of the most efficient and powerful ways to manipulate your data.

    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-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT