Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

ADO Recordsets: Creating and Manipulating Data with ADO, Slides of Fundamentals of E-Commerce

An overview of ado recordsets, explaining how to create and use them to retrieve and manipulate data using various methods. Topics covered include creating snapshot and updateable cursors, moving through records, and checking for end-of-file and beginning-of-file conditions.

Typology: Slides

2012/2013

Uploaded on 07/30/2013

shoki_sho
shoki_sho 🇮🇳

4.8

(8)

139 documents

1 / 10

Toggle sidebar

Related documents


Partial preview of the text

Download ADO Recordsets: Creating and Manipulating Data with ADO and more Slides Fundamentals of E-Commerce in PDF only on Docsity! The RecordSet Object • Used to return rows to the client. • #1 most used part of ADO • Can be created alone or with a connection object to "pool" connections. • Can be used to execute stored procedures without parameters. • Can be created w/o a connection object • Is created from "ADODB.Recordset" Docsity.com Using the connection object to return a recordset ' You can use a select statement to 'create' a snapshot forward only, ' read only cursor. (A "firehose" cursor) dim rs 'as ADODB.Recordset dim mySQL 'as string mySQL = "Select * from authors" Set rs = CN.Execute mySQL '... Use cursor rs.Close set rs = nothing Docsity.com Recordset Methods • .MoveFirst, .MoveLast, .MovePrevious, .MoveNext (moves cursor in rows, error if .EOF or .BOF or if .RecordCount = 0) • .Move n (moves number of rows specified by, see note above) • .AddNew (adds a new row to recordset, applies defaults if any, needs to be followed by .Update) • .Update (commits changes to .Recordset) • .UpdateBatch (use in addition to update with batch locking) Docsity.com Recordset Example #1 'Assuming rs is a ADODB.Recordset object If rs.State = adStateOpen Then If rs.RecordCount <> 0 Then rs.MoveFirst While not rs.EOF '… do something with records rs.MoveNext Wend End IF End If Docsity.com Explanations #1a • EOF and BOF are functions that return true if we are at the end or beginning of a recordset. To check to make sure we are actually on a good (usable record) we should: If not (rs.EOF or rs.BOF) Then Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved