ADO - Befehlsobjekt


Befehlsobjekt

Das ADO Command-Objekt wird verwendet, um eine einzelne Abfrage für eine Datenbank auszuführen. Die Abfrage kann Aktionen wie das Erstellen, Hinzufügen, Abrufen, Löschen oder Aktualisieren von Datensätzen ausführen.

Wenn die Abfrage zum Abrufen von Daten verwendet wird, werden die Daten als RecordSet-Objekt zurückgegeben. Das bedeutet, dass die abgerufenen Daten durch Eigenschaften, Sammlungen, Methoden und Ereignisse des Recordset-Objekts manipuliert werden können.

Das Hauptmerkmal des Command-Objekts ist die Fähigkeit, gespeicherte Abfragen und Prozeduren mit Parametern zu verwenden.


ProgID

set objCommand=Server.CreateObject("ADODB.command")

Eigenschaften

Property Description
ActiveConnection Sets or returns a definition for a connection if the connection is closed, or the current Connection object if the connection is open
CommandText Sets or returns a provider command
CommandTimeout Sets or returns the number of seconds to wait while attempting to execute a command
CommandType Sets or returns the type of a Command object
Name Sets or returns the name of a Command object
Prepared Sets or returns a Boolean value that, if set to True, indicates that the command should save a prepared version of the query before the first execution
State Returns a value that describes if the Command object is open, closed, connecting, executing or retrieving data

Methoden

Method Description
Cancel Cancels an execution of a method
CreateParameter Creates a new Parameter object
Execute Executes the query, SQL statement or procedure in the CommandText property

Sammlungen

Collection Description
Parameters Contains all the Parameter objects of a Command Object
Properties Contains all the Property objects of a Command Object