Database Commands SECTION 6 Functions and Methods
105
return = DBExecute(level, command, parameter)
Remarks
Typical Examples
Pos = DBExecute("Northwind.Order Details", "Find",
"UnitPrice > 14.00")
Find the next record satisfying the specified criteria, starting from the current
position. Valid search criteria include: "ProductName LIKE 'G*' " wildcard
search finds all records where ProductName starts with 'G', "Quantity = 5",
"Price >= 6.99". Only single search values are allowed, using multiple values
with 'AND' or 'OR' will fail.
DBExecute("Connection1.Recordset1", "Source",
"Table2")
Modify the Recordsets source to open a different table than configured.
DBExecute("Northwind.Shippers", "Filter",
"CompanyName = 'United Package'")
Apply a filter to display only records with a company name 'United Package'
DBExecute("Northwind.Shippers", "Filter", "")
Cancel an existing filter (by passing an empty string)
DBExecute Commands
Argument Type Description
return 1 if the function is successful otherwise 0
except for "Find" and "FindNext" commands
which return the record number if found or if
not, set the current record to EOF and return -
1.
level text A text point or constant specifying the
connection level, which depends on the
command specified.
command text Command to execute. May be one of the
commands listed below.
parameter text Command parameter only required with certain
commands. For "Connection", this parameter
should hold the new connection string. For
"Find" and "FindNext" this parameter should be
the search criteria. For "Source" this is the
Recordset source. For "Filter" this is the
Recordset filter.
Command Connection
Level
Description
Connection Connection Modify the connection string.
BeginTrans Connection Begins a new Transaction.
CommitTrans Connection Saves any pending changes and ends
the current transaction.
RollbackTrans Connection Cancels any changes made and ends
the transaction.
CommitTransAll Connection Saves all changes and ends all
transactions.