Do anybody know how to obtain RecordNum from last inserted record. RecordNum is defined in MYTABLE as IDENTITY column.
To insert new record I issue AddNew and Update methods from Recordset object.
Then I create SQL statement like this
SELECT @@IDENTITY AS RecNo FROM MYTABLE
COMMAND object and issue EXECUTE method for this object, get result Recordset pRsCommand and then retrieve result like this:
lRecNo = (long)pRsCommand->Fields->Item[_variant_t("RecNo")]->Value.lVal
Connection object is the same.
It doesn't crash but however the result obtained is like -13110.
What is wrong in this scenario.
I use Pervasive SP4 and Visual C++ 6.0.
In Pervasive Control Center it works as it should be.
Thank you for any help