Board index » delphi » Delphi5, Pervasive and Identity field type

Delphi5, Pervasive and Identity field type

Hi, list!
Exist a mode to get a new identity field value after a insert
without call dataset refresh?

TIA

AS

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

 

Re:Delphi5, Pervasive and Identity field type


Quote
"Alberto Salvati" <a.salv...@mclink.it> wrote in message <news:de589e36ac1a7e0a610c5687e5be1df3.9005@mygate.mailgate.org>...
> Exist a mode to get a new identity field value after a insert
> without call dataset refresh?

By Identity I mean MS SQL Identity field type.
This depends on what your application is based - BDE or ADO.
On ADO after Table.Post value can be retrieved by simple
Table.Fieldbyname('SOME_NAME').asinteger.
On BDE - really I don't remember, may be the above mentioned is correct
for BDE. If not - use Table.Prior (or Table.First) Table.Next (or Table.Last)
sequence before using Table.Fieldbyname('SOME_NAME').asinteger.
You may also try methods which are updating record buffer but I think they
will not work.

Re:Delphi5, Pervasive and Identity field type


Quote
> Hi, list!
> Exist a mode to get a new identity field value after a insert
> without call dataset refresh?

   What a database server are you using?

Re:Delphi5, Pervasive and Identity field type


Quote
> > Hi, list!
> > Exist a mode to get a new identity field value after a insert
> > without call dataset refresh?

>    What a database server are you using?

I'm sorry, didn't see the subject line :)

Re:Delphi5, Pervasive and Identity field type


Quote
> By Identity I mean MS SQL Identity field type.

I don't know M$Sql.

On Pervasive, identity field is assigned server side.
I use bde and, at this moment, to get field value i need
to call a refresh (query.close;query.open) or
a statement like select @@identity from.
This return last identity value used in active session.

Bye

AS

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

Other Threads