Suppose you create a new record in a database with a command sequence like:
<code>
sql = "EXEC 'insert into users (name) values ([name])'"
oConn.Execute(sql)
</code>
and suppose the database automatically create the value for the keyfield of the new record. How would you extract the new keyfield value and assign it to a variable? I've been told it can be done with something like:
<code>
newkeyID = oConn.Execute("EXEC 'return users.keyID'")
</code>
but this doesn't work for me.
Thanks
<code>
sql = "EXEC 'insert into users (name) values ([name])'"
oConn.Execute(sql)
</code>
and suppose the database automatically create the value for the keyfield of the new record. How would you extract the new keyfield value and assign it to a variable? I've been told it can be done with something like:
<code>
newkeyID = oConn.Execute("EXEC 'return users.keyID'")
</code>
but this doesn't work for me.
Thanks