zsolt Messages: 698 Registered: December 2005 Location: Budapest, Hungary
Contributor
Put a breakpount there or do a log and check the content of the string or the error message from the SQL backend.
Sorry but I have no exlerience with queries like that, since I use U++.
I create dynamic queries with SqlExp.
SqlBool where = (SOMEFIELD == some_value);
if(!(~some_ctrl).IsNull){
where = where && OTHERFIELD = ~some_ctrl;
}
if(!(~find).IsNull){
String s = ~find;
s << '%';
where = where && Like(THIRDFIELD, s);
}
sql * Select(SqlAll())
.From(SOMETABLE)
.Where(where);