Execute

<< Click to Display Table of Contents >>

 

Execute

Execute([ImmediateExecute])

The Execute 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 (.e3i and .e3o files) before reaching the database (if False) or it is sent directly to the database (if 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. Example of SQL commands:

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

 

Example:

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

Was this page useful?