DescriptionThis will execute an SQL statement against an underlying data sourceSyntaxFunction Execute( command, hints, result )Parametersstring command - the SQL statement to executevariant hints - execution hint(s) (optional):"true" or "ignore" - to ignore any errors"norep" - not to replace invalid characters in the statementarray result - the execution result (optional)Return Valuesvariant the result of the execution as follows:Empty - if no records were returned, or all the field values are NULLA scalar value - the result of an UPDATE SQL operation, or the record ID of a new record created by an INSERT operationA single Array - when only one field was requested. When only a single record is returned, it will be an array with a single item in it.An Array which contains another Arrays - the outer array represents fields, the inner arrays contain values for each fields.
Function Execute( command, hints, result )
command
hints
"true"
"ignore"
"norep"
result
Empty
Array
ExampleTo populate an array by a record's values:Dim fieldsthis.DS.Execute "SELECT TOP 1 * FROM MyTable", fieldsfields now is an array filled with values from the record's fields.
To populate an array by a record's values:
Dim fieldsthis.DS.Execute "SELECT TOP 1 * FROM MyTable", fields
Dim fields
this.DS.Execute
"SELECT TOP 1 * FROM MyTable",
fields
Dim count
count = this.DS.Execute( "UPDATE Employees SET Salary=65000 WHERE Age > 45" )
count now contains the number of affected recordsSee also
count