Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 5 of 5 total |
Easy upgrade table |
Sat, Mar 18 2006 4:03 PM | Permanent Link |
"Brian Gustavsen" | want to do a simple design so that I could "show" how i want the table to
look like. but is does not work.. what do i do wrong and how do you do it ?? procedure Tdm.CreateLocationTable; begin with tblCreator.FieldDefs do begin Clear; Add('ILOCATION',ftAutoInc,0,True); Add('LOCATION',ftString,100,True); Add('PARENT',ftInteger,0,false); //if i want i new field I just want to add it to the def.. but does not wokr ;( Add('test',ftInteger,0,false); end; with tblCreator.IndexDefs do begin Clear; end; CreateTable('LOCATION'); end; procedure Tdm.CreateTable(aTableName: String); var TableToCreate: TDBISAMTable; begin TableToCreate:=TDBISAMTable.Create(nil); try with TableToCreate do begin DatabaseName:=DBISAMDatabase1.DatabaseName; TableName:=aTableName; //Exclusive:=True; FieldDefs:=tblCreator.FieldDefs; IndexDefs:=tblCreator.IndexDefs; if not TableToCreate.Exists then begin CreateTable(0,0) end else begin try FieldDefs.Update; IndexDefs.Update; FieldDefs:=tblCreator.FieldDefs; IndexDefs:=tblCreator.IndexDefs; AlterTable(0,1); except // on e:exception do showmessage(e.Message); end; end; end; finally TableToCreate.Free; end; end; |
Mon, Mar 20 2006 11:23 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Brian,
<< want to do a simple design so that I could "show" how i want the table to look like. but is does not work.. what do i do wrong and how do you do it ?? >> What portion of your code is causing the problem ? Are you getting an error message ? -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Mar 20 2006 12:11 PM | Permanent Link |
"Brian Gustavsen" | well no it just dont upgrade the table/ create the missing field
-- gusse www.gusse.net "Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message news:EABE8C0B-0B9D-4AE4-9C60-8CF0E3B52EE1@news.elevatesoft.com... > Brian, > > << want to do a simple design so that I could "show" how i want the table > to look like. but is does not work.. > > what do i do wrong and how do you do it ?? >> > > What portion of your code is causing the problem ? Are you getting an > error message ? > > -- > Tim Young > Elevate Software > www.elevatesoft.com > > |
Tue, Mar 21 2006 4:00 AM | Permanent Link |
"Frans van Daalen" | "Brian Gustavsen" <bg@gusse.net> wrote in message news:76FE7ADD-5D4A-44F2-8077-10E3D51EF4BA@news.elevatesoft.com... > want to do a simple design so that I could "show" how i want the table to > look like. but is does not work.. > > what do i do wrong and how do you do it ?? > > > //Exclusive:=True; must not be commented out i think I also use " Active:=False;" and at the end " AlterTable()" if altered and "CreateTable(0,0,0,False,'','',4096,512,0)" for well.....create |
Tue, Mar 21 2006 2:28 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Brian,
<< well no it just dont upgrade the table/ create the missing field >> I tried the following code here and it worked fine with 4.22 B6 (I commented out the 'Test' field definition addition for the first run and then un-commented it on the second run): procedure TForm1.Button1Click(Sender: TObject); begin with tblCreator.FieldDefs do begin Clear; Add('ILOCATION',ftAutoInc,0,True); Add('LOCATION',ftString,100,True); Add('PARENT',ftInteger,0,false); //if i want i new field I just want to add it to the def.. but does not wokr ;( Add('test',ftInteger,0,false); end; with tblCreator.IndexDefs do begin Clear; end; CreateTable('LOCATION'); end; procedure TForm1.CreateTable(aTableName: String); var TableToCreate: TDBISAMTable; begin TableToCreate:=TDBISAMTable.Create(nil); try with TableToCreate do begin DatabaseName:='c:\winnt\temp'; TableName:=aTableName; //Exclusive:=True; FieldDefs:=tblCreator.FieldDefs; IndexDefs:=tblCreator.IndexDefs; if not TableToCreate.Exists then begin CreateTable(0,0) end else begin try FieldDefs.Update; IndexDefs.Update; FieldDefs:=tblCreator.FieldDefs; IndexDefs:=tblCreator.IndexDefs; AlterTable(0,1); except // on e:exception do showmessage(e.Message); end; end; end; finally TableToCreate.Free; end; end; -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Thursday, March 28, 2024 at 06:05 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |