Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread What docs show field size limits
Mon, Nov 3 2008 8:14 PMPermanent Link

Joel Schaubert

I have taken over an application that uses Borland C++ 6.0 and dbiasm 3.x.

When restructuring a table to raise the limit of a string from 70 to 255 I get this error.

   OptionsTable->Exclusive = true;
   OptionsTable->RestructureFieldDefs->Update();
   OptionsTable->RestructureFieldDefs->Delete(1);
  
OptionsTable->RestructureFieldDefs->Insert(1,25,"IMPFILENAM",ftString,255,false,"","","","");

   OptionsTable->RestructureTable(0,0,1,2,false,"","Options table",512,false);
   OptionsTable->Close();

exception class EDatabaseError with message "Invalid field size"


After looking through the help file, online help, and searching the boards I could not
find answers to 2 questions.
So mostly I want learn how to find things in the docs.

What I would like to know is

A) how would I search the docs to find out what the size limitations are for the various
dbisam field types?

B) Where can I look to find the API signature for RestructureFieldDefs->Insert in the docs?

thanks,
Joel
Tue, Nov 4 2008 11:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joel,

<< When restructuring a table to raise the limit of a string from 70 to 255
I get this error. >>

The max string field length for 3.x is 250.

<< A) how would I search the docs to find out what the size limitations are
for the various dbisam field types? >>

The information on capacities is in the Appendix of the online help file:
manc6.hlp (.cnt).  This help file is located in the \help subdirectory of
the main DBISAM installation directory.

<< B) Where can I look to find the API signature for
RestructureFieldDefs->Insert in the docs? >>

It's in the Component Reference section of the same help file.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Nov 4 2008 11:31 AMPermanent Link

Joel Schaubert

<< A) how would I search the docs to find out what the size limitations are
for the various dbisam field types? >>

The information on capacities is in the Appendix of the online help file:
manc6.hlp (.cnt).  This help file is located in the \help subdirectory of
the main DBISAM installation directory.


Thanks, that's exactly what I was looking for.



<< B) Where can I look to find the API signature for
RestructureFieldDefs->Insert in the docs? >>

It's in the Component Reference section of the same help file.


No I don't think so, The closest I can find is a general section on restructuring tables.
If you look at that you can see the API for the  Insert method is not shown,
Specifically the insert required 2 integer fields up  front and I can't find docs that
show what they mean.
I believe I have figured it out from usage in my code but I would like learn how to find
the API information from the docs as well.

Here's a cut and paste from the manual, it does show usage

     RestructureFieldDefs.Insert(6,8,'LastSaleAmount',ftBCD,2,False,
                               '','','','',fcNoChange);

but no where I can find does it list the API for Insert, specifically I could not find the
definition for the second integer ( the 8).

Joel
Tue, Nov 4 2008 2:41 PMPermanent Link

"Raul"
Like Tim said : Component Reference > TDBISAMFieldDefs > Insert Method

(e.g.
http://www.elevatesoft.com/manual?action=mancompmethod&id=dbisam4&product=r&version=2007&comp=TDBISAMFieldDefs&method=Insert)

and the general section on Creating and Altering tables explains the field
num and index position  : Using DBISAM > Creating and Altering Tables

http://www.elevatesoft.com/manual?action=mantopic&id=dbisam4&product=r&version=2007&category=1&topic=15


These links are for DBISAM4 but as i recall this was conceptually similar in
v3 (v3 has restructure while v4 has alter but idea is the same)

Raul




> No I don't think so, The closest I can find is a general section on
> restructuring tables.
> If you look at that you can see the API for the  Insert method is not
> shown,
> Specifically the insert required 2 integer fields up  front and I can't
> find docs that
> show what they mean.
> I believe I have figured it out from usage in my code but I would like
> learn how to find
> the API information from the docs as well.
>
> Here's a cut and paste from the manual, it does show usage
>
>      RestructureFieldDefs.Insert(6,8,'LastSaleAmount',ftBCD,2,False,
>                                '','','','',fcNoChange);
>
> but no where I can find does it list the API for Insert, specifically I
> could not find the
> definition for the second integer ( the 8).
>
> Joel
>
Tue, Nov 4 2008 3:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joel,

<< No I don't think so, The closest I can find is a general section on
restructuring tables. If you look at that you can see the API for the
Insert method is not shown, Specifically the insert required 2 integer
fields up  front and I can't find docs that show what they mean. >>

I'll check it out, but we froze 3.x many years ago, so we won't be releasing
any fixes for such issue, and the best I can do is just give you the source
code.

<< I believe I have figured it out from usage in my code but I would like
learn how to find the API information from the docs as well. >>

The Component Reference is where you will find the information that you
need.  Like I said above, I'm not quite sure why the RestructureFieldDefs
methods aren't showing up, but apart from that, the rest of the Component
Reference should be complete.

<< but no where I can find does it list the API for Insert, specifically I
could not find the definition for the second integer ( the 8). >>

Here are the interface declarations:

     procedure Add(const Name: string; DataType: TFieldType; Size: Word;
        Required: Boolean; DefaultValue: string; MinValue: string;
MaxValue: string;
        Description: string; CharCase: TFieldCharCase; FieldNo: Integer);
overload;

     procedure Add(FieldNo: Integer; const Name: string; DataType:
TFieldType; Size: Word;
        Required: Boolean; DefaultValue: string=''; MinValue: string='';
        MaxValue: string=''; Description: string='';
        CharCase: TFieldCharCase=fcNoChange); overload;

     procedure Insert(Index: Integer; const Name: string; DataType:
TFieldType; Size: Word;
        Required: Boolean; DefaultValue: string; MinValue: string;
MaxValue: string;
        Description: string; CharCase: TFieldCharCase; FieldNo: Integer);
overload;

     procedure Insert(Index: Integer;  FieldNo: Integer; const Name:
string;
        DataType: TFieldType; Size: Word; Required: Boolean;
        DefaultValue: string=''; MinValue: string='';
        MaxValue: string=''; Description: string='';
        CharCase: TFieldCharCase=fcNoChange); overload;

     procedure Delete(Index: Integer);

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Nov 5 2008 2:10 PMPermanent Link

Joel Schaubert

From the last 2 postings I now can see what mistake I made when looking up

TDBISAMFieldDefs.Insert

I think it is not documented in the v3 online help, but that's totally fine as long as I
can look it up somewhere else.

My mistake was that when I got to this page via google
http://www.elevatesoft.com/manual?action=mancompmethod&id=dbisam4&product=d&version=5&comp=TDBISAMFieldDefs&method=Insert

I read the first API and saw that it did not match what I'm trying to use.
I did not read the second API which is a match.

That's my bad.
As long as I have one good method to lookup the needed API's then I have everything I need.

Thank you Tim and Raul for your answers.

Joel
Wed, Nov 5 2008 3:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joel,

<< My mistake was that when I got to this page via google
http://www.elevatesoft.com/manual?action=mancompmethod&id=dbisam4&product=d&version=5&comp=TDBISAMFieldDefs&method=Insert I read the first API and saw that it did not match what I'm trying to use.I did not read the second API which is a match. >>Yes, and the DBISAM 3.x documentation isn't available on the web, so theremay be some differences between the two that aren't always obvious.  I wouldrefer to the 3.x documentation except where it is not present (this case).The documentation got an overhaul in 4.x, so it is much more complete than3.x in this respect.--Tim YoungElevate Softwarewww.elevatesoft.com
Image