LPARAMETERS tcBaseTable LOCAL lnConHnd, lnOldArea, luRetVal *** we are overriding the parent logic for FireBird databases *** we are also assuming that the generator is named as follows *** gen_maccounts_iid lnOldArea = SELECT(0) lnConnHnd = CURSORGETPROP("ConnectHandle") SQLEXEC(lnConnHnd , [SELECT gen_id(GEN_] + STRTRAN(tcBaseTable, "DBO.", "") ; + [_IID, 1) AS nNextId from rdb$database]) *** 15/07/2006 new VFP9 behaviour will not return an empty cursor IF USED("sqlResult") luRetVal = VAL(sqlResult.nNextID) ELSE *** 15/07/2006 FB return such a number(?) to signify non-existant generator luRetVal = 2147483647 + 1 ENDIF *** If going beyond the Integer values IF NOT BETWEEN(luRetVal, -2147483647, 2147483647) luRetVal = 1 SQLEXEC(lnConnHnd , [SET GENERATOR GEN_] + STRTRAN(tcBaseTable, "DBO.", "") ; + [_IID TO 1]) lncnt = AERROR(laerr) FOR lni = 1 TO lncnt WAIT WINDOW laerr[lni, 1] && 1526 WAIT WINDOW laerr[lni, 2] && Connectivity error: invalid request BLR at offset 25 generator GEN_MSERVICEOFFICE_IID is not defined WAIT WINDOW laerr[lni, 3] && invalid request BLR at offset 25 generator GEN_MSERVICEOFFICE_IID is not defined WAIT WINDOW laerr[lni, 4] && HY000 WAIT WINDOW laerr[lni, 5] && 335544343 WAIT WINDOW laerr[lni, 6] && 3 WAIT WINDOW laerr[lni, 7] && .NULL. endfor ENDIF CloseUsed("sqlResult") SELECT (lnOldArea) RETURN luRetVal