🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4710

Retrieving an AutoIncrement field

#4710
From: Steve Clarke
Date: Mon, 19 Nov 2001 08:19
30 lines
1501 bytes
Got a little problem here: I need to get to value of an autoincrement after 
its posted.

My previous method was something like this.

using an ADOTable with the fields:
AutoInc    	    	Table_ID;
varchar(255)    	Description;

my code would be something like this:
...
table->Open();
table->Insert();
table->FieldByName("Description")->Value = "Test";
table->Post();
table->Refresh();
int id = table->FieldByName("Table_ID")->AsInteger;
...

This works ok most times. But on a large dataset the refresh method causes 
the calling app to hang...

I've applied the ADO updates and CBuilder5 updates and still no joy.

We are using MySQL via ODBC.

I really hope someone can help with this as I am aging prematurely.

Thanks,
    	Steve Clarke.
Technical Details
Message-ID: <Xns915E68F29D1CFstevehascoza19283746@207.105.83.65>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,7fd8fe9bf38091e0,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-19 00:36:32 PST
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Retrieving an AutoIncrement field
From: Steve Clarke <steve@h-a-s.co.za>
Organization: H.A.S Software
Message-ID: <Xns915E68F29D1CFstevehascoza19283746@207.105.83.65>
User-Agent: Xnews/4.06.22
NNTP-Posting-Host: 168.209.28.202
Date: 19 Nov 2001 00:19:19 -0800
X-Trace: dnews 1006157959 168.209.28.202 (19 Nov 2001 00:19:19 -0800)
Lines: 34
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews