Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Execute - method of object PmDatabase

Description:
It serves to the execution of the SQL statement in the database defined by the Database property. The method can be called if the PmDatabase object was connected to the database, for example, by calling the Connect method.
Syntax:
Execute(sSQL As String, nOptions As Long) As Long
Calling:
n = oDb.Execute(sSQL, nOptions)
Parameters:
sSQL(String) statement in the SQL language syntax
nOptions(Long) mode selection of the statement execution
0 - without alternative possibilities
pmcDbSQLPassThrough - the SQL statement passed without the syntax correction by the PmDatabase object. It can be entered only when the Technology configurator is set to Direct access to table - DAO. See the note below.
pmcDbFailOnError - on error in processing the SQL statement it returns the database into the state before calling the Execute method
Note:
By this method the SQL statement that returns the set of rows (e.g. the SELECT statement), can't be executed.
 
If the Technology configurator is set to Access through ODBC (or it is set to Direct access to table - DAO and the pmcDbSQLPassThrough constant is used by calling the method):
- then the SQL statement in the method must comply with the syntax of the database to which the PmDatabase object is connected.
- otherwise the SQL statement in the method must comply with the SQL syntax used in MS DAO. See: Description of handling PmDatabase object referencing to existing table.
See also:
Example:
Calling the procedure saved in MS SQL Server with the proc name name
oDb.Execute "EXECUTE proc_name", pmcDbSQLPassThrough
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice