Execute

<< Click to Display Table of Contents >>

 

Execute

Execute([ImmediateExecute])

This method executes a SQL command that does not have a return, such as DELETE, UPDATE, or INSERT, configured in the Query's SQL property. The ImmediateExecute parameter indicates whether the operation passes through database operation queues, that is, .e3i and .e3o files, before reaching the database, if configured as False, or it is sent directly to the database, if configured as True. If this parameter is omitted, the operation is sent directly to the 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?