Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Table not being created, but no error message
Tue, Mar 23 2010 10:26 AMPermanent Link

Richard

ENT Technologies

I have a procedure to create a new database:

procedure cd_CreateEmptyDatabase(DatabaseDirectory : String);
var
   Database : TEDBDatabase;
begin

   Session.Execute('CREATE DATABASE "Rep4" PATH ' +
                             Engine.QuotedSQLStr(DatabaseDirectory));

   Database := TEDBDatabase.Create(Nil);
   Database.DatabaseName := 'Rep4DB';
   Database.Database := 'Rep4';
   Database.Open;

   Database.Execute('CREATE TABLE "System"' +
                               '(' +
                               '"Key" SMALLINT,' +
                               '"StringValue" CHARACTER(40) COLLATE ANSI_CI,' +
                               '"IntegerValue" INTEGER,' +
                               '"FloatValue" FLOAT,' +
                               '"DateValue" DATE,' +
                               '"TimeValue" TIME,' +
                               '"CONSTRAINT "Key_PrimaryKey" PRIMARY KEY ("Key")' +
                               ')');
   Database.Close;
   Database.Free;

end;


I call this procedure with the following code:

DatabaseDirectory := 'C:\Users\Public\Rep4\Data\';

if Session.Execute('SELECT * FROM Configuration.Databases WHERE Name = ' +
                            Engine.QuotedSQLStr('Rep4')) = 0 then
   cd_CreateEmptyDatabase(DatabaseDirectory);



I'm using Delphi 2010 under Windows 7. This code runs, but when I look at the database directory using Windows Explorer, all I see are the catalog and configuration files. I can't see any actual tables. There are no errors being generated.
Tue, Mar 23 2010 11:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard


>I'm using Delphi 2010 under Windows 7. This code runs, but when I look at the database directory using Windows Explorer, all I see are the catalog and configuration files. I can't see any actual tables. There are no errors being generated.

I've never tried looking just after creating a database and tables but I wouldn't be surprised not to see any tables. ElevateDB is not like DBISAM. With the latter the metadata was held in the table and hence the table files had to be created when a table was. With ElevateDB the metadata is held in the catalog and the table files aren't needed until you open them.

Just try opening your tables you should be OK.

Roy Lambert [Team Elevate]
Tue, Mar 23 2010 12:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< I'm using Delphi 2010 under Windows 7. This code runs, but when I look at
the database directory using Windows Explorer, all I see are the catalog and
configuration files. I can't see any actual tables. >>

The tables aren't created until you try and open them, at which time
ElevateDB will automatically create them.  The database catalog determines
the existence of a table, not the table files themselves.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image