You should loom into the sapdb SEQUENCE objects. This is how I do it. Carl
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Alexei Livchits Sent: 26 September 2002 04:26 PM To: [EMAIL PROTECTED] Subject: ODBC, serial data type, adding new row, getting new id Hi, i have a problem: after inserting a new line with addnew/update, I need the new ID. With ms ACCESS is it simple: I just get a new id. But with sap db is it impossible. Here is my code: ------------------------------------------------------------ ---------------- oRs.Open "SELECT * FROM TESTTABLE", Conn, 1, 3 oRs.AddNew oRs("TESTCOLUMN") = False oRs.Update NewID = oRs("BLOCK_ID") ' NewID is empty ------------------------------------------------------------ ---------------- at the moment i do it in this way: ------------------------------------------------------------ ---------------- oRs.Open "SELECT * FROM TESTTABLE", Conn, 3(!), 3 oRs.AddNew oRs("TESTCOLUMN") = False oRs.Update oRs.Requery oRs.MoveLast NewID = oRs("BLOCK_ID") ------------------------------------------------------------ ---------------- This way is not ideal. Best regards, Alexei Livchits e-mail: [EMAIL PROTECTED] _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general _______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
