Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRY/CATCH With SQL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01270081
Message ID:
01270212
Views:
12
Thanks Sergey! That did it.



>You have to check return value from SQLEXEC() and if it less than 0 (-1) use AERROR() to get detailed ODBC error info.
>
>>The following does not trigger the CATCH block when a SQL error occurs.
>>oException.ErrorNo = 0 even when a SQL error occurs. What am I doing wrong?
>>
>>
>>oException = CREATEOBJECT("RFException")
>>
>>TRY
>>	SQLEXEC(._iSQLConnHandle, sQuery, sTableName)
>>CATCH TO oException
>>ENDTRY
>>
>>IF ._HandleError(oException)
>>
>>	SQLEXEC(._iSQLConnHandle, "SELECT @@ROWCOUNT AS AffectedRows", "SQLTally")
>>	iRowsAffected = SQLTally.AffectedRows
>>
>>	USE IN SQLTally
>>
>>ENDIF
>>
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform