Problem with TUniScript
Posted: Mon 07 Oct 2013 13:24
Hello,
I'm having a problem with TUniScript on Firebird embedded 2.5 after the upgrade to Delphi XE5 + UniDAC 5.1.4.
I'm creating an empty database, and calling the same procedure twice. This procedure will load an SQL script from an external file and execute it. The first script contains CREATE TABLE statements (multiple tables), and the second INSERT statements to fill the database.
The Connection is defined as follows:
The procedure is quite simple:
At the end the structure is Ok, but the database is empty. Am I missing something or do I need to change something due to the autocommit changes in 5.1?
I'm having a problem with TUniScript on Firebird embedded 2.5 after the upgrade to Delphi XE5 + UniDAC 5.1.4.
I'm creating an empty database, and calling the same procedure twice. This procedure will load an SQL script from an external file and execute it. The first script contains CREATE TABLE statements (multiple tables), and the second INSERT statements to fill the database.
The Connection is defined as follows:
Code: Select all
Connection.Username := 'sysdba';
Connection.Password := 'masterkey';
Connection.Server := '';
Connection.Database := DatabaseFile;
Connection.ProviderName := 'InterBase';
Connection.SpecificOptions.Values['Charset'] := 'UTF8';
Connection.SpecificOptions.Values['UseUnicode'] := 'True';
Connection.SpecificOptions.Values['ClientLibrary'] :=
IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName))+'fbclient.dll';Code: Select all
if Connection.Connected then begin
SQLScript := TUniScript.Create(nil);
SQLScript.Connection := Connection;
SQLScript.SQL.LoadFromFile(ScriptFile);
SQLScript.OnError := ScriptFileError;
SQLScript.Execute;
SQLScript.Free;
end;