Active Query Builder 2 .NET Edition reference
SqlError Event (QueryBuilder)

Invoked on SQL text parsing error.
Public Event SqlError As SqlErrorEvenHandler
Dim instance As QueryBuilder
Dim handler As SqlErrorEvenHandler
AddHandler instance.SqlError, handler
public event SqlErrorEvenHandler SqlError
public: __event SqlErrorEvenHandler* SqlError

The sql parameter is the SQL query text that failed to parse. The error parameter is the error message string. The errorToken parameter is the erroneous token string. The errorTokenPos parameter addresses the erroneous token in the SQL query text.

            public struct Pos
                public int pos;  // token position in the source text (starting at 0)
                public int col;  // token column (starting at 0)
                public int line; // token line (starting at 1)

You can control the behavior of the component on parsing unknown types of SQL statements or on parsing queries with unknown objects using the BehaviorOptions properties: AllowSleepMode, ParsingErrorOnUnknownObjects.

private void queryBuilder1_SqlError(object sender, string sql,
    string error, string errorToken, Pos errorTokenPos)
        "Unexpected token \"{0}\" at line {1}, column {2}",
        errorToken, errorTokenPos.line, errorTokenPos.col));
See Also


QueryBuilder Class
QueryBuilder Members



© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback