Executes the supplied SQL command against the Datasource.
object.Execute ( Command ) |
- Command
- Required. A String that specifies the SQL command.
Variant
If the Command is a SELECT statement, the return value is a Recordset object and you must use the MoveFirst method to access the recordset.
var objDS = Map.Layers("Poles").Datasource
var objCountRS = objDS.Execute("SELECT COUNT(*) FROM Poles")
objCountRS.MoveFirst();
MessageBox(objCountRS.Fields(1).value);
otherwise, the return value is the number of rows affected by the command.
var objDS = Map.Layers("Poles").Datasource
var objCount = objDS.Execute("DELETE FROM POLES WHERE MATERIAL = 'Al'")
MessageBox(objCount)