![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Next, you use the data connections BOF (beginning-of-file) and EOF (end-of-file) methods to determine whether the current record within the recordset is the first or last record, respectively. If you are not at the beginning or end of the recordset, you can display the fields, for example. The following code uses a Do…While loop to print the transaction IDs in the recordset: <% If myDBConnection.EOF === you are at the end of the record set Else If myDBConnection.BOF === you are at the beginning of the record set Else Do While Not myDBConnection.EOF === loop through the result set Response.Write (myDBConnection(Transaction_ID) & <BR>) Loop End if %> The ADO object model includes the following objects, each of which is covered in detail in subsequent sections:
The Connection Object The Connection object establishes a connection with a system data source. In addition, you can use the Connection object to pass SQL instructions for the database server to process. Like most objects, Connection has a set of useful properties that you can reference. These include
You can also perform operations on the Connection object by employing one of the following methods:
The Recordset Object In the ADO model, the Recordset object holds the results of a database query. You can create a Recordset object in a number of ways. You can create the object by using the Connection or Command objects, or by using the Recordset object itself. If you use the ADO Recordset object, you get to set the resulting recordsets properties. If you establish a Recordset using the Connection or Command object, you cannot set the resulting recordsets properties. Listing 33.5 shows an example of using the ADO Recordset to create a new Recordset object. Listing 33.5 Creating a New Recordset object with ADO.Recordset Set myRecordset=Server.CreateObject(ADO.Recordset) myRecordset.Source= myRecordset.RecordCount=20 myRecordset.Open
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |