The Ultimate Site for Jobs and
Education
presents
Visual Basic - ADO Tutorial
This tutorial illustrates using the ADO (ActiveX Data Objects)
programming model to query and update a data source. First, it describes the steps
necessary to accomplish this task. Then the tutorial is repeated in Microsoft®
Visual Basic®; Microsoft® Visual C++®, featuring VC+ + Extensions; Microsoft®
Visual Basic®, Scripting Edition; and Microsoft® Visual J++™, featuring ADO for
Windows Foundation Classes (ADO/WFC). This tutorial Is coded in different
languages for two reasons:
• The documentation for ADO assumes the reader codes in Visual Basic. This makes the documentation convenient
for Visual
Basic programmers, but less useful for programmers who use other languages.
• If you are uncertain about a particular ADO feature and you know
a little of another language, you may be able to
resolve your question by looking for the same feature expressed
in another language.
How the Tutorial is Presented:
This tutorial is based on the ADO programming model. It discusses
each step of the programming model individually. In addition, it illustrates
each step with a fragment of Visual Basic code. At the end, it restates and
integrates the code fragments as a Visual Basic example.
The code example is repeated in other languages, however, without
the discussion. Each step in a given programming language tutorial is marked
with the corresponding step in the programming model and descriptive tutorial.
Use the number of the step to refer to the discussion in the descriptive
tutorial.
Because this tutorial consists of several small fragments of code,
you cannot execute the code as written.
The ADO programming model is restated below. Use it as a roadmap
as you proceed through the tutorial.
ADO Programming Model with Objects:
• Make a connection to a data source (Connection). Optionally,
begin a transaction.
• Optionally, create an object to represent an SQL command (Command).
• Optionally, specify columns, tables, and values in the SQL
command as variable parameters (Parameter).
• Execute the command (Command, Connection, or Recordset).
• If the command is row-returning, store the rows in a storage
object (Recordset).
• Optionally, create a view of the storage object so you can sort,
filter, and navigate the data (Recordset).
• Edit the data, either adding, deleting, or changing rows and
columns (Recordset).
• If appropriate, update the data source with changes from the
storage object (Recordset).
• If a transaction was used, accept or reject the changes made
during the transaction. End the transaction
(Connection).
| About Us | | Feedback | | Advertise | | Contact Us |
| Copyright © 2001 www.vengy.com. All rights reserved. |
| Brought to you by Vengysoft, Inc. |