Execute

<< Click to Display Table of Contents >>

 

Execute

Execute([ImmediateExecute])

This method executes SQL commands that do not have a return, such as DELETE, UPDATE, or INSERT, configured in a Query's SQL property. The ImmediateExecute parameter indicates whether that operation passes through operation queues, that is, .e3i and .e3o files, before reaching a Database, if configured as False, or it is sent directly to a Database, if configured as True. If this parameter is omitted, the operation is sent directly to a Database. The advantage of using a Query to execute commands is the use of variables, such as in a simple Query. The next code contains examples of SQL commands.

DELETE FROM test WHERE cod > 10
UPDATE test SET cod = 10 WHERE cod > 10
INSERT INTO test (cod) VALUES(10)

 

The next script contains an example of using this method.

Sub CommandButton1_Click()
  Screen.Item("Query1").Execute
End Sub

Was this page useful?