🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Database Transactions.

#4230
From: Tony Forgan
Date: Tue, 26 Feb 2002 23:42
27 lines
1660 bytes
Hi,

I am just wondering about Database Transactions. I have a case where I need
the ID of a newly created record in a table to be stored in another table,
all during a transaction. Is this possible? At the moment it is not
returning the new record's id.

ie.
DB->StartTransaction
    Table2->Insert
    ...
    Table2->Post
    id=Table2->FieldByName("ID")->AsInteger
    Table1->FieldByName("Table2ID")->AsInteger=id
    Table1->Post
    DB->Commit

Any help would be greatly appreciated.

Thanks.
--
Tony Forgan - (B.I.T.)
Systems Analyst
Wild Lime - tony@wildlime.com
Studio 1, 72 McLeod Street, Cairns 4870
Web www.wildlime.com
Tel 07 4081 6677 | Fax 07 4081 6679
Technical Details
Message-ID: <3c7c1dfc_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,2ae92d6da780eff0,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-02-26 15:55:31 PST
Reply-To: "Tony Forgan" <tony@wildlime.com>
From: "Tony Forgan" <tony@wildlime.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Database Transactions.
Date: Wed, 27 Feb 2002 09:42:10 +1000
Lines: 29
Organization: Wild Lime Media
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 144.137.157.12
Message-ID: <3c7c1dfc_2@dnews>
X-Trace: dnews 1014767100 144.137.157.12 (26 Feb 2002 15:45:00 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews