Search notes:

ADODB.Command: execute

command.execute executes the action (typically an SQL statement) for which its command object was parametrized.
cmd.execute(recordsAffected, parameters, options)
All three parameters of execute are optional.
execute() returns a recordSet object.
Apparently, by default, an execution is not performed within a transaction.

Basic sequence of steps to execute a command

The following steps are required to execute a command. The language in which those are written is Visual Basic for Applications:
dim conn  as adodb.connection
 
conn.open "provider=...;...;..."
   
dim cmd as new adodb.command
    
set cmd.activeConnection = conn
cmd.commandType          = adCmdText
cmd.commandText          = "update table set col_1 = :val_1, col_2 = :val_2 where col_3 = :val_3"

dim param as adodb.parameter

set param = cmd.createParameter(, adInteger, adParamInput    ): cmd.parameters.append param
set param = cmd.createParameter(, adDate   , adParamInput    ): cmd.parameters.append param
set param = cmd.createParameter(, adVarChar, adParamInput, 99): cmd.parameters.append param    
      
cmd.parameters(0) = 42
cmd.parameters(1) = no
cmd.parameters(2) ="hello world"

dim nofRowsUpdated as long

'   Finally.... the statement can be executed:
'
cmd.execute nofRowsUpdated

debug.print(nofRowsUpdated & " rows were updated")

See also

The ADODB command object.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745581747, '18.119.0.68', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/ADO/objects/command/execute/index(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78