Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to execute more than 1 update with SQLEXE
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01522041
Message ID:
01522100
Views:
32
>>>if SQLEXEC(nHandle, m.lcSQL) <0
>>> &&Check the actual error with aerror()
>>>ENDIF
>>>
>>>I think your code was OK also, but better to write them as separate lines and you should always check the return value of SQLExec.
>>
>>Thank you, Naomi. Just as I read your message I realized why I had the problem last night. I am trying to make my code work on both VFP and SQL Server. And I was testing last night on VFP. And of course, this type of syntax would not apply to VFP at all. So I will probably execute each UPDATE separately. I wonder, though, if I could enclose these two UPDATE (for SQL Server) with Transaction so that I can undo changes if one of the UPDATEs fails. I will test it.
>
>It may be better to enclose them into explicit transaction. Most likely they already will be part of implicit transaction, but better to not rely on this.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform