Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 16 total
Thread creating tables
Mon, Oct 8 2007 5:21 AMPermanent Link

"Andrej Bivic"
I am moving from ver2.12 to 4.25.
I have some code troubles regarding table creation.
What is wrong with the code below:

     TableToUpdate := TDBISAMTable.Create(Application);
     try
       with TableToUpdate do begin
         DatabaseName := DatabasePath;
         TableName := 'PodatkiMaticni.dat';
         Exclusive := True;
         if not Exists then begin
            CreateTable;
         end;
         with FieldDefs do begin
           Clear;
           Add('Zapst', ftAutoInc, 0, False );
           Add('Naziv1', ftString, 40, False);
           Add('Naziv2', ftString, 40, False);
           Add('Naslov1', ftString, 40, False);
           Add('Naslov2', ftString, 40, False);

         end;
         with IndexDefs do begin
           Clear;
           Add('', 'Zapst', [ixPrimary,ixUnique], '',icFull);
           Add('Naziv1', 'Naziv1', [], '', icFull);
         end;
         AlterTable(KodaJezika, 0, 0, False, '', '', 512, 5);
        end;
     finally
       TableToUpdate.Free;
     end;

I get the message, that too many fields are encounterd??

Please advise.

Mon, Oct 8 2007 11:40 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Andrej,

<< I am moving from ver2.12 to 4.25.  I have some code troubles regarding
table creation.  What is wrong with the code below:

I get the message, that too many fields are encounterd?? >>

Are you getting the error message during the CreateTable method call, or
during the AlterTable method call ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Oct 8 2007 12:51 PMPermanent Link

"Andrej Bivic"
During CreateMetod, since I'am trying to create that table.
Andrej

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:F3472779-5F19-4F6E-879C-CCD32CAC9DC3@news.elevatesoft.com...
> Andrej,
>
> << I am moving from ver2.12 to 4.25.  I have some code troubles regarding
> table creation.  What is wrong with the code below:
>
> I get the message, that too many fields are encounterd?? >>
>
> Are you getting the error message during the CreateTable method call, or
> during the AlterTable method call ?
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Mon, Oct 8 2007 2:30 PMPermanent Link

"Robert"

"Andrej Bivic" <andrej.bivic@abitrade.si> wrote in message
news:51D3AE85-0208-4C45-A09D-F64D3EE4A149@news.elevatesoft.com...
>
> I get the message, that too many fields are encounterd??
>

Actually, I think the message is that too few (zero) fields are creted. You
need to do the create table at the end, as in

         if exists then DeleteTable;
         Exclusive := True;

         with FieldDefs do begin
           Clear;
           Add('Zapst', ftAutoInc, 0, False );
           Add('Naziv1', ftString, 40, False);
           Add('Naziv2', ftString, 40, False);
           Add('Naslov1', ftString, 40, False);
           Add('Naslov2', ftString, 40, False);

         end;
         with IndexDefs do begin
           Clear;
           Add('', 'Zapst', [ixPrimary,ixUnique], '',icFull);
           Add('Naziv1', 'Naziv1', [], '', icFull);
         end;
         if not Exists then begin
            CreateTable;
         end;

Robert

Tue, Oct 9 2007 2:45 AMPermanent Link

"Iztok Lajovic"
Andrej,

> What is wrong with the code below:
>
>      TableToUpdate := TDBISAMTable.Create(Application);
>      try
>        with TableToUpdate do begin
>          DatabaseName := DatabasePath;
>          TableName := 'PodatkiMaticni.dat';
>          Exclusive := True;
>          if not Exists then begin
>             CreateTable;                            <<< remove this line
>          end;                                             <<< remove this
> line
>          with FieldDefs do begin
>            Clear;
>            Add('Zapst', ftAutoInc, 0, False );
>            Add('Naziv1', ftString, 40, False);
>            Add('Naziv2', ftString, 40, False);
>            Add('Naslov1', ftString, 40, False);
>            Add('Naslov2', ftString, 40, False);
>
>          end;
>          with IndexDefs do begin
>            Clear;
>            Add('', 'Zapst', [ixPrimary,ixUnique], '',icFull);
>            Add('Naziv1', 'Naziv1', [], '', icFull);
>          end;
>          AlterTable(KodaJezika, 0, 0, False, '', '', 512, 5);   <<<<
> remove this line and add the folloving two line lines
           CreateTable(KodaJezika, 0, 0, False, ",",512,5);
           end;
>         end;
>      finally
>        TableToUpdate.Free;
>      end;
>
> I get the message, that too many fields are encounterd??
>

Iztok Lajovic

Tue, Oct 9 2007 4:51 AMPermanent Link

"Frans van Daalen"

"Iztok Lajovic" <iztok.lajovic@amis.net> wrote in message
news:96B352F3-02A5-4B3C-A558-DBC5915DC842@news.elevatesoft.com...
> Andrej,
>
>>             CreateTable;                            <<< remove this line
>>          end;                                             <<< remove this
>> line
>>          AlterTable(KodaJezika, 0, 0, False, '', '', 512, 5);   <<<<
>> remove this line and add the folloving two line lines
>            CreateTable(KodaJezika, 0, 0, False, ",",512,5);

Or change

AlterTable(KodaJezika, 0, 0, False, '', '', 512, 5);

to

AlterTable();

Tue, Oct 9 2007 6:56 AMPermanent Link

"Andrej Bivic"
Yes. This has changed from ver 2.12. I still get an error. This one:
"Maximum or minimum limits on index page size, the number of indexes or the
number of fields in an index exceeded in the table"

Please, advise on thise one to.

Andrej

"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote in message
news:987C7C24-D2B2-4B74-BFDC-AE8A7EEFACA2@news.elevatesoft.com...
>
> "Andrej Bivic" <andrej.bivic@abitrade.si> wrote in message
> news:51D3AE85-0208-4C45-A09D-F64D3EE4A149@news.elevatesoft.com...
>>
>> I get the message, that too many fields are encounterd??
>>
>
> Actually, I think the message is that too few (zero) fields are creted.
> You need to do the create table at the end, as in
>
>          if exists then DeleteTable;
>          Exclusive := True;
>
>          with FieldDefs do begin
>            Clear;
>            Add('Zapst', ftAutoInc, 0, False );
>            Add('Naziv1', ftString, 40, False);
>            Add('Naziv2', ftString, 40, False);
>            Add('Naslov1', ftString, 40, False);
>            Add('Naslov2', ftString, 40, False);
>
>          end;
>          with IndexDefs do begin
>            Clear;
>            Add('', 'Zapst', [ixPrimary,ixUnique], '',icFull);
>            Add('Naziv1', 'Naziv1', [], '', icFull);
>          end;
>          if not Exists then begin
>             CreateTable;
>          end;
>
> Robert
>

Tue, Oct 9 2007 9:09 AMPermanent Link

"Robert"

"Andrej Bivic" <andrej.bivic@abitrade.si> wrote in message
news:4E3118FB-22D4-4A77-8801-15722A48CA45@news.elevatesoft.com...
> Yes. This has changed from ver 2.12. I still get an error. This one:

Your index page is too small for this table.

Robert

> "Maximum or minimum limits on index page size, the number of indexes or
> the number of fields in an index exceeded in the table"
>
> Please, advise on thise one to.
>
> Andrej
>
> "Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote in message
> news:987C7C24-D2B2-4B74-BFDC-AE8A7EEFACA2@news.elevatesoft.com...
>>
>> "Andrej Bivic" <andrej.bivic@abitrade.si> wrote in message
>> news:51D3AE85-0208-4C45-A09D-F64D3EE4A149@news.elevatesoft.com...
>>>
>>> I get the message, that too many fields are encounterd??
>>>
>>
>> Actually, I think the message is that too few (zero) fields are creted.
>> You need to do the create table at the end, as in
>>
>>          if exists then DeleteTable;
>>          Exclusive := True;
>>
>>          with FieldDefs do begin
>>            Clear;
>>            Add('Zapst', ftAutoInc, 0, False );
>>            Add('Naziv1', ftString, 40, False);
>>            Add('Naziv2', ftString, 40, False);
>>            Add('Naslov1', ftString, 40, False);
>>            Add('Naslov2', ftString, 40, False);
>>
>>          end;
>>          with IndexDefs do begin
>>            Clear;
>>            Add('', 'Zapst', [ixPrimary,ixUnique], '',icFull);
>>            Add('Naziv1', 'Naziv1', [], '', icFull);
>>          end;
>>          if not Exists then begin
>>             CreateTable;
>>          end;
>>
>> Robert
>>
>
>

Tue, Oct 9 2007 1:44 PMPermanent Link

Andrej Bivic
Tnx, can you make a suggestion? I am confused, since my code has worked under 2.12. Smile

Andrej

Tue, Oct 9 2007 4:52 PMPermanent Link

"Robert"

"Andrej Bivic" <andrej.bivi@abitrade.si> wrote in message
news:87B15D2F-8F13-4BFE-8755-AF3E54AE6056@news.elevatesoft.com...
> Tnx, can you make a suggestion? I am confused, since my code has worked
> under 2.12. Smile
>

Since you obviously have no reason to change it, why not just take the
defaults?

AlterTable(YourLocaleID);

Robert

Page 1 of 2Next Page »
Jump to Page:  1 2
Image