Board index » delphi » ADO append / post in Access

ADO append / post in Access

Hi just a short question

When you do an append .... post command against a Access dB
and you want to retrieve the new UID for this record
what is the best way of retrieving it ?

(the UID would be a access autonumber)

Stig

-----
Tempus omnia revelat

Stig Norland
Software Developer
LOOPsys
http://www.loopsys.com

 

Re:ADO append / post in Access


Try

INSERT INTO <TABLENAME> (Field1, Field2) VALUES (Value1, Value2)

/Thomas

Quote
Stig Norland <s...@anonymous.net> wrote in message

news:82llld$hcv5@forums.borland.com...
Quote
> Hi just a short question

> When you do an append .... post command against a Access dB
> and you want to retrieve the new UID for this record
> what is the best way of retrieving it ?

> (the UID would be a access autonumber)

> Stig

> -----
> Tempus omnia revelat

> Stig Norland
> Software Developer
> LOOPsys
> http://www.loopsys.com

Re:ADO append / post in Access


Quote
Thomas B?ge <no.Junk.thomas.bo...@get2net.dk> wrote in message

news:82lq87$hho3@forums.borland.com...

Quote
> Try

> INSERT INTO <TABLENAME> (Field1, Field2) VALUES (Value1, Value2)

> /Thomas

What I was looking for was  a:
             append:
             ...
             post;
             try
                refresh;
             except on e:exception do
            ...
            UID := FieldValues['UID'];

I had some problems with the refresh method,
but after some tweeking I fixed it...

Tanks
Stig

-----
Tempus omnia revelat

Stig Norland
Software Developer
LOOPsys
http://www.loopsys.com

Other Threads