John,
Good idea. Have you tried doing it with one connection? As long as you have a candidate key, you ought to be able to make two queries on the same connection - or even in the same SQLEXEC() call:
lcSQL = "INSERT INTO table VALUES (x,y,z); SELECT pk FROM table"
lnResult = SQLEXEC(hConn, lcSQL)
-Mike