If this script exists, Stonefield Query calls it rather than displaying an error message when the SQL statement for a report fails. This allows you to handle the error quietly or display your own custom message.
You can access the running report object through the global variable Report.
Parameters
A reference to the Stonefield Query Application object and the reason for the error from the ODBC error message.
Return Value
Any value (Stonefield Query ignores the return value).
Example
This simple example just displays the reason for the failure in a message box.
Visual FoxPro
lparameters toApplication as SQApplication, tcReason
messagebox('The report failed because ' + tcReason)
VBScript
function Main(Application, Reason)
msgbox "The report failed because " & Reason
C#
The method in this script must be named DataEngine_HandleSQLError.
public static void DataEngine_HandleSQLError(SFQApplication sfqApplication,
string reason)
{
MessageBox.Show("The report failed because " + reason);
}
VB.NET
The method in this script must be named DataEngine_HandleSQLError.
public shared function DataEngine_HandleSQLError(sfqApplication as SFQApplication,
reason as string) as Boolean
MessageBox.Show("The report failed because " + reason)
Return True
End Function
See also
Scripts© Stonefield Software Inc., 2024 • Updated: 06/06/16
Comment or report problem with topic