beginners tutorial - Learn VB6
VB6 tutorial - Learn Advanced VB6
VB .NET - Learn Visual Basic .NET
Analysis - System analysis and Design tutorial for Software Engineering
You are here: Visual
Basic > Advanced VB6 tutorial
> Chapter 8
To programmatically initialize a Command object, you should take the following
Make sure that you have a valid Connection, as discussed earlier in the section
"Programming the Connection Object."
Declare an object variable of the type ADODB.Command.
Set the CommandType property.
Set the CommandText property.
Call the Execute method.
Set the ActiveConnection property to point to a valid existing Connection object.
NOTE - Further References: For examples and
more information about the Execute method, see "Using
Stored Procedures to Return Records to an Application" in Chapter
9 and the sections under "ADO Data
Access Models" in the next chapter,
"Creating Data Services: Part II." Also see "Using
the Parameters Collection to Access Parameters for Stored Procedures" in the
next chapter for information about how to pass parameters to a stored procedure.
Surprise! ADO Command objects don't have any events. If you try to declare
a Command object variable using the WithEvents keyword, you will receive a compiler
error. Only Connection and Recordset objects support events in the ADO object
<< Previous | Contents
| Next >>
| Contact Us