![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Addressed for Version 1.04 » View Incident Report |
![]() |
Reported By: Grzegorz Rewucki Reported On: 6/22/2007 For: Version 1.04 Build 2 |
procedure TForm1.FormCreate(Sender: TObject); var DBPath: string; i: Integer; begin DBPath := ExtractFileDir(ParamStr(0)); Engine.ConfigPath := DBPath; Engine.TempTablesPath := DBPath; Session.LoginUser := 'Administrator'; Session.LoginPassword := 'EDBDefault'; with MetaQuery do begin Close; DatabaseName := 'Configuration'; SQL.Text := 'SELECT * FROM Databases WHERE Name = ''TestDB'''; RequestSensitive := True; Open; if (RecordCount = 0) then begin Close; SQL.Text := 'CREATE DATABASE "TestDB" PATH ' + AnsiQuotedStr(DBPath, ''''); ExecSQL; end; Close; EDB.Database := 'TestDB'; EDB.DatabaseName := 'TestDB'; EDB.Open; DatabaseName := 'TestDB'; SQL.Text := 'SELECT * FROM Information.Tables WHERE Name = ''TestTab'''; RequestSensitive:=True; Open; if (RecordCount = 0) then begin Close; SQL.Clear; SQL.Add('CREATE TABLE "TestTab"'); SQL.Add('('); SQL.Add('"Id" GUID DEFAULT CURRENT_GUID,'); SQL.Add('"MyName" VARCHAR(30) COLLATE "PLK_CI",'); SQL.Add('"MyDate" DATE DEFAULT CURRENT_DATE,'); SQL.Add('CONSTRAINT "PK_TestTab" PRIMARY KEY ("Id")'); SQL.Add(')'); ExecSQL; Close; SQL.Text := 'CREATE INDEX "TestTab_MyDate_Idx" ON TestTab(MyDate)'; ExecSQL; end; Close; end; with GridQuery do begin DatabaseName := 'TestDB'; SQL.Text := 'SELECT * FROM TestTab ORDER BY MyDate'; RequestSensitive:=True; Open; if IsEmpty then begin for I := 0 to 10 do begin Insert; FieldByName('MyName').AsString := 'Name'+IntToStr(i); Post; end; end; end; end;
This web page was last updated on Tuesday, April 23, 2024 at 08:39 AM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |