Execute

This function will execute a pass-through SQL statement on the host through the connection maintained by the server. Any results from the statement will be returned in a text-delimited object. (Note: this means that the item is a static view of the database and cannot be updated.)

Group: Database Related Extensions


Syntax:

[vErrNo =] DB.Execute(sSQL, [vColumns], [vRows])

vErrNo        (Variant) Optional – is a return value; a value of '0' (zero numeric) means the SQL statement processed normally.

sSQL          (String) is the SQL statement to be sent to the database. As this is a pass through statement, its syntax must be understood by the database, as no pre-processing will occur.

vColumns   (Variant) Optional – is a string representation of the columns returned by the SQL statement. This is optional because Insert, Update, and other statements do not return data.

vRows        (Variant) Optional – is a string representation of the static rows of an SQL statement. This is optional because Insert, Update, and other statements do not return data.

Example:

Dim sSQL As String

Dim sCols As String

Dim sRows As String

sSQL = "select * from Inventory"

DB.Execute(sSQL, sCols, sRows)

In the case of an insert or an update, the sCols and sRows variables would not be necessary because no recordset is returned.