ArcPad Scripting Object Model
Execute Method
See Also  Send comments on this topic.
Command
Required. A String that specifies the SQL command.
DataSource Object : Execute Method

Glossary Item Box

Description

Executes the supplied SQL command against the Datasource.

Syntax

object.Execute ( Command )

Parameters

Command
Required. A String that specifies the SQL command.

Return Type

Variant

Remarks

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)

Example

See Also

© 2013 All Rights Reserved.