|
From: Michael v. B. <m.b...@xe...> - 2018-05-14 12:34:26
|
Our problem is that we use ADO in our hole application.
We have many places like this in our code:
ADODB::_RecordsetPtr prs = NULL;
CREATEINSTANCE(prs, ADODB::Recordset);
prs->CursorLocation = ADODB::adUseClient;
prs->Properties->Item["Update Resync"]->Value =
(long)ADODB::adResyncAll;
prs->Open(_bstr_t("SELECT * FROM TestTable WHERE 1=0"),
(IDispatch *)m_pConnection, ADODB::adOpenKeyset, ADODB::adLockOptimistic,
ADODB::adCmdText);
prs->AddNew();
prs->Fields->Item["Name"]->Value = "Some Text";
prs->Update();
long id = (long)prs->Fields->Item["ID"]->Value;
// throws an DB_E_DELETEDROW
prs->Close();
prs = NULL;
Is there a way to use INSERT RETURNING in ADO?
Michael von Boetticher
-----Ursprüngliche Nachricht-----
Von: Dimitry Sibiryakov [mailto:sd...@ib...]
Gesendet: Montag, 14. Mai 2018 12:48
An: fir...@li...
Betreff: Re: [Firebird-odbc-devel] reading the just generated identity
throws an exception
14.05.2018 12:46, Michael von Boetticher wrote:
> I need to know the generated ID for further actions in other subtables.
> Has somebody the same issue and even better - a solution for this?
Use INSERT RETURNING.
--
WBR, SD.
----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most engaging
tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Firebird-odbc-devel mailing list
Fir...@li...
https://lists.sourceforge.net/lists/listinfo/firebird-odbc-devel
|