Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
Table not being created, but no error message |
Tue, Mar 23 2010 10:26 AM | Permanent 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 AM | Permanent Link |
Roy Lambert NLH Associates 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |