(OpenLink + wxWidgets )Database Query issue with single quotes in where clause

Thomas Zehbe tz at ingenion.de
Fri May 25 07:50:45 PDT 2007


Hi,

I'm missing a BaseTable.Open() between the SetColDefs() and the Query().

Without Open() the colums are not bound to the variables. Maybe that's the 
problem.
Regards,
Thomas


Am Freitag, 25. Mai 2007 16:34 schrieb vikas:
> I would like to add more info about the given issue
>
> 1. I am using XCode on macintosh
>
> Code Snippet is given below
>
> Query Syntax is similar to below given query :
> Select name,employer from XYZ where name = 'abc'
>
> wxDbTable BaseTable(ptrDB, wxT("XYZ"), 53, (const wxString
> &)wxEmptyString, wxDB_QUERY_ONLY);
>
> BaseTable.SetColDefs(0,	wxT("name")	  ,DB_DATA_TYPE_VARCHAR	  ,
> arrName	   , SQL_C_WXCHAR  , 19*sizeof(wxChar)	, true, true);
> BaseTable.SetColDefs(1,	wxT("employer")	 ,DB_DATA_TYPE_VARCHAR	 ,
> arrEmployer	, SQL_C_WXCHAR	, 41*sizeof(wxChar)   , true, true);
>
> if (!BaseTable.QueryBySqlStmt(strQuery))
> {
>          Query is not executing because where clause used in query has
> quotes bt when i try to execute query like
>
>          Select name,employer from XYZ where id=16 it executes fine
>
>          thats why i conclude that there is some problem with single
> quotes usage on MAC+Open Link combination
>
>          Can anyone help me out on this.
> }
>
> Thanks again!!!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org

-- 
Dipl.-Ing. Thomas Zehbe
INGENION GmbH
Kuhweide 6
31552 Apelern
Fon: 05043 / 40 57 90 4
Fax: 05043 / 40 57 90 7
www.ingenion.de




More information about the wx-users mailing list