You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With MS-Access I used the identity column as primary key for table joining.
Firebird gives the possibility to create a similar table with:
CREATE TABLE TestTable (ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, Name VARCHAR(50));
The whole app is written with ADO, so I'd like to use the firebird ODBC. But here occurs the following problem:
reading the just generated identity throws an exception, I didn't have with MS-Access.
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;
I need to know the generated ID for further actions in other subtables.
The text was updated successfully, but these errors were encountered:
Submitted by: Michael von Boetticher (michael)
With MS-Access I used the identity column as primary key for table joining.
Firebird gives the possibility to create a similar table with:
CREATE TABLE TestTable (ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, Name VARCHAR(50));
The whole app is written with ADO, so I'd like to use the firebird ODBC. But here occurs the following problem:
reading the just generated identity throws an exception, I didn't have with MS-Access.
I need to know the generated ID for further actions in other subtables.
The text was updated successfully, but these errors were encountered: