ADO ObjectsLesson 70Free preview
ADO Command
This lesson is part of ASP · All levels
Summary
The ADODB.Command object represents a single SQL command or stored procedure that can be run repeatedly with parameters. The command text is stored on the CommandText property, while the parameters are added through the Parameters collection. This approach is not only safe from injection, but also allows queries to be recompiled and executed more efficiently.
Key points
- CommandText contains a SQL or stored procedure name.
- Parameters are created with CreateParameter and then appended to the Parameters collection.
- Execute returns the Recordset to the SELECT query or the number of lines affected.
- Parameters query is safer and more efficient than dynamic strings.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.