>Dear Martin
>
>Thanks for helping me.
>But I want to know
>
>Should I not use
>
>Begin Transaction -- End Transaction
>
>Because you have removed it from my codes
BEGIN TRANSACTION and END TRANSACTION are VFP commands that affect VFP tables. They have no impact on SQL Server. Check out SQLSetProp and specifically the Transactions property for controlling remote transactions.
I also want to point out that your code would be more readable if you use NOT rather than comparison with logical values. That is, at least in my view, it's easier to read and understand:
IF NOT MyFlag
than
IF MyFlag = .F.
Tamar