Active Query Builder 2 .NET Edition reference
ValidateQuery Method
Example 



SQL query text.
SQL parsing error message string.
Validates the given SQL query for compliance with the rules of SQL syntax.
Syntax
'Declaration
 
Public Function ValidateQuery( _
   ByVal sql As System.String, _
   ByRef errorInfo As System.String _
) As System.Boolean
'Usage
 
Dim instance As BaseSyntaxProvider
Dim sql As System.String
Dim errorInfo As System.String
Dim value As System.Boolean
 
value = instance.ValidateQuery(sql, errorInfo)
public System.bool ValidateQuery( 
   System.string sql,
   ref System.string errorInfo
)
public: System.bool ValidateQuery( 
   System.string* sql,
   ref System.string* errorInfo
) 

Parameters

sql
SQL query text.
errorInfo
SQL parsing error message string.

Return Value

true if the query is valid; false otherwise.
Remarks
Please note that Active Query Builder does not perform validation against specific database context, i.e. presence of table fields, function parameters, constants, etc.
Example
Validates a query against rules of MS SQL Server syntax.
MSSQLSyntaxProvider syntax = new MSSQLSyntaxProvider();
string errorInfo = "";
 
if (!syntax.ValidateQuery("select * from Orders", ref errorInfo))
{
   MessageBox.Show(errorInfo);
}
See Also

Reference

BaseSyntaxProvider Class
BaseSyntaxProvider Members

 

 


© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback