Objek Perintah ADO


Objek Perintah

Objek Perintah ADO digunakan untuk mengeksekusi satu kueri terhadap database. Kueri dapat melakukan tindakan seperti membuat, menambahkan, mengambil, menghapus, atau memperbarui catatan.

Jika kueri digunakan untuk mengambil data, data akan dikembalikan sebagai objek RecordSet. Ini berarti bahwa data yang diambil dapat dimanipulasi oleh properti, koleksi, metode, dan kejadian dari objek Recordset.

Fitur utama dari objek Command adalah kemampuan untuk menggunakan kueri dan prosedur yang tersimpan dengan parameter.


ID Prog

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

Properti

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

Metode

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

Koleksi

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