Charlie,
thanks - I am well aware of "key table" techniques, but am trying to use SQL identity fields and @@identity since it is more "SQL 7 Centric" if you will, rather than pulling keys "before the fact" as I do in pure VFP.
Ken
>Ken:
>
>You can create a stored procedure that generates the next available key then return it to the client with code like this:
>
>lnKey = 0
>= sqlexec(lnhandle, "{CALL spGetKey (?@lnKey)}")
>
>or
>
>What I do is get a key at the start of an application using the above code, then each time I need a new key I concatenate it with a key generated on the client. This way you save round trips to the server each time you need a new key.
>
>Charlie
Ken B. Matson
GCom2 Solutions