DbExecute
ODBC function.
The DbExecute function executes a SQL command on the current dataset. Not available in WinTask Lite.
Syntax
DbExecute("<SQL_command>")
or
Ret = DbExecute("<SQL_command>")Parameter
<SQL_command> : any valid SQL command to be executed on the current dataset.
Return value
Ret, numeric return code. If the SQL command has been performed successfully, the function returns 0, otherwise use this return code for error management.
Examples
DbConnect("DSN=gpao;PWD=SILOG") ' connection to ODBC database named gpao
DbExecute("UPDATE Article SET Price=Price+100") ' updates the table Article
DbDisconnect()
DbConnect("DSN=gpao;PWD=SILOG") ' connection to ODBC database named gpao
DbExecute("INSERT into Article (article,label) VALUES ('WinTask-DP','Development pack')") ' inserts new values in the table Article
DbDisconnect()
DbConnect("DSN=gpao;PWD=SILOG") ' connection to ODBC database named gpao
DbExecute("DELETE from Article WHERE Price<50") ' deletes selected records in the table Article
DbDisconnect()