|
AnyDAC
|
Executes SQL command and optionally opens dataset.
True, if a command returned result set.
Use OpenOrExecute method, if you does not know - will command return result set or not. The most common case for that is the execution of an ad hoc query.
The OpenOrExecute method executes SQL command. And if command returns any result set, then this method opens dataset. The method supplements Open and Execute / ExecSQL / ExecProc methods:
At OpenOrExecute call a "[AnyDAC][Phys]-308" may be raised, but it will be not propagated out of the method.
function OpenOrExecute: Boolean;
TDataSet.Open, Execute, TADCustomQuery.ExecSQL, TADCustomStoredProc.ExecProc
ADQuery1.Disconnect(True); ADQuery1.SQL.Assign(Memo1.Lines); if ADQuery1.OpenOrExecute then begin PageControl1.ActivePage := DataGridPage; DataGridPage.TabVisible := True; end else DataGridPage.TabVisible := False;
|
What do you think about this topic? Send feedback!
|