Subject Re: [IBO] .RecordCount doesn't have the same functionality as with BDE
Author Dennis Fantoni
There is some litterature on the ibo website, check the faq and look for
"Generatorlinks"
that is probably what you need.

i do this in my app (converted from BDE just finished a few days ago)

var
table1id:integer;

table1.append
newid:=table1.gen_id('mygenerator');
table1.fieldbyname('id').asinteger:=newid;
table1.fieldbyname('allotherfields').asstring:='whatever':
etc.
table.post


anothertableid:=table1.gen_id('mygenerator');
anothertable.fieldbyname('id'):=newid;
anothertable.fieldbyname('idtotable1').asinteger:=newid;
etc
anothertable.post

this makes anothertable have a reference to table1 and i've got the ids at
once in table1id and anothertableid

the .gen_id('mygenerator') uses an interbase "generator" to generate a
unique value for my tables.

The generatorlinks property is meant to be used to automate the above
process

there is a lot of descriptions in the faq about this. It is not exactly
straightforward, but after a few rereads i got the general idea, and opted
for the solution described at the top (because i need the id in my app
afterwards)

where do you work? i see we're both in Denmark..

Regards
Dennis Fantoni

dennis@...
C/S Developer ( Delphi & Interbase ) at Danasoft A/S -
http://www.danasoft.dk

----- Original Message -----
From: "Kurt Bilde" <kub@...>
To: <IBObjects@egroups.com>
Sent: Tuesday, November 28, 2000 5:30 PM
Subject: [IBO] .RecordCount doesn't have the same functionality as with BDE


> Hi All !
>
> I'm porting a BDE application from BDE to Interbase.
>
> I've been told and expirenced that the TIBOTable's RecordCount doesn't
have the same functionality as TTable.RecordCount. TIBOTable's RecordCount
shows only the RecordCount at connection time and not during the
applications lifetime (if added one record then RecordCount + 1 ect.). Then
somebody told me that If I needed then accurate row count I could either
call fetchall or I could cast it to TIBODataset and it will figure out the
true count of records by running a count statement on the server for me.
>
> Well .FetchAll doesn't work (and I can't figure out what the person ment
with "cast to IBODataset") and I can't see how .FetchAll reflect
filtering.
>
> As I understand it I need a primary key to be able to insert?
> Then I could use a TIB_Query with the .Refresh metode to solve my problem,
couldn't I?. Some of my table doesn't have a primary key and this was solved
in Paradox by using a AutoIncrement field. But how do I create this kind
variable in Interbase (type) and with IBO(assigning the uniq number to the
field)?
>
> -Kurt
>
>
>
>
>
>