![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 Manual for RAD Studio XE (Delphi) » Using ElevateDB » Executing Scripts |
begin
with MyDatabase do
begin
DatabaseName:='AccountingDB';
Database:='Accounting';
Connected:=True;
end;
with MyScript do
begin
DatabaseName:='AccountingDB';
SQL.LoadFromFile('c:\scripts\GetLedgerEntries.sql');
Active:=True;
end;
end;begin
with MySession do
begin
SessionName:='Remote';
SessionType:=stRemote;
RemoteAddress:='192.168.0.2';
Active:=True;
end;
with MyScript do
begin
SessionName:='Remote';
DatabaseName:='Accounting';
SQL.Clear;
SQL.Add('SCRIPT ()');
SQL.Add('BEGIN');
SQL.Add(' EXECUTE IMMEDIATE ''BACKUP DATABASE Test ');
SQL.Add(' AS TestBackup TO STORE "Backups" ');
SQL.Add(' INCLUDE CATALOG'';');
SQL.Add('END');
ExecScript;
end;
end;| Method | Usage |
| ExecScript | Use this method when the script specified in the SQL property may or may not return a result set. The ExecScript method can handle both situations. |
| Open | Use this method only when you know that the script specified in the SQL property will return a result set. Using the Open method with a script that does not return a result set will result in an EDatabaseError exception being raised with an error message "Error creating table handle". |
begin
with MyDatabase do
begin
DatabaseName:='AccountingDB';
Database:='Accounting';
Connected:=True;
end;
with MyScript do
begin
DatabaseName:='AccountingDB';
SQL.LoadFromFile('UpdateLedgerEntries.SQL');
Prepare;
ParamByName('AccountNo').AsString:='00100';
ExecScript;
end;
end;This web page was last updated on Tuesday, September 16, 2025 at 04:56 PM | Privacy Policy © 2026 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

