>Hi,
>
>I have created a Form based on remote view of a table in MS SQL Database, that have a primary key.
>
>If the record is new, after I have enter the primary key, I need to control if the code exist already.
>
>I have not problem with the dbf file, but I have some difficulty with SQL database.
>
>Someone can help me, in order to resolve this problem ?
>
>Thank you.
>
>Best Regards
luNewKey = < key to check >
lnHandle = CursorGetProp("ConnectHandle",'myRemoteViewAlias')
SQLExec(lnHandle,;
"select count(*) as myCount from myTable where PkID = ?m.luNewKey","crsCheckKey")
llExists = (crsCheckKey.myCount > 0)
PS: If you use GUID as a key you don't need to check.
Cetin