Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Problem with autoinc
Wed, Oct 4 2006 11:26 AMPermanent Link

"Robert"
Difference between 4.24 V1 and 3.30 - using a memory table

in V4, an autoinc value is not available in AfterPost (it is in V3) two
questions

1. Is this a bug, or is it as designed?
2. I changed the program to use table.LastAutoIncValue. Seems to work OK,
but I feel uneasy about this. Is there ANY reliable way in V4 to get  in
AfterPost the autoinc assigned to the record just posted?

Robert

Wed, Oct 4 2006 3:51 PMPermanent Link

Jeff Cook
"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote on Wed, 4 Oct 2006 11:22:21 -0400

>2. I changed the program to use table.LastAutoIncValue. Seems to work OK,
>but I feel uneasy about this. Is there ANY reliable way in V4 to get in
>AfterPost the autoinc assigned to the record just posted?
>
Robert


Have you tried Refresh or maybe just read the record again?

Cheers


Jeff
--
Jeff Cook
Aspect Systems Ltd
Phone: +64-9-424 5388
Skype: jeffcooknz
www.aspect.co.nz



Wed, Oct 4 2006 4:31 PMPermanent Link

Bernd Kuhlmann
Robert,
> Difference between 4.24 V1 and 3.30 - using a memory table
>
> in V4, an autoinc value is not available in AfterPost (it is in V3) two
> questions
>
> 1. Is this a bug, or is it as designed?
> 2. I changed the program to use table.LastAutoIncValue. Seems to work OK,
> but I feel uneasy about this. Is there ANY reliable way in V4 to get  in
> AfterPost the autoinc assigned to the record just posted?

How do you try to access the new value?

I have created a simple program with a table, a datasource and a dbgrid.
If i add this AfterPost event, the caption always shows the value of the id
field (id is an autoinc).

procedure TForm1.tbAfterPost(DataSet: TDataSet);
begin
 caption:=dataset.fieldByName('id').asString;
end;


Bernd Kuhlmann
Wed, Oct 4 2006 5:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Robert,

<< in V4, an autoinc value is not available in AfterPost (it is in V3) two
questions >>

It should be.  As Bernd asked, how are you accessing it ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Oct 4 2006 5:51 PMPermanent Link

"Robert"

"Bernd Kuhlmann" <bernd.kuhlmann1@ewetel.net> wrote in message
news:C9948C31-0D3F-46FE-8EED-3A46347117C2@news.elevatesoft.com...
>
> How do you try to access the new value?
>
> I have created a simple program with a table, a datasource and a dbgrid.
> If i add this AfterPost event, the caption always shows the value of the
> id
> field (id is an autoinc).
>

You are correct. For some reason the rather convoluted way in which the
program was handling the after posting process worked with V3. It should not
have.

Robert

Image