setwhereclause problem

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
Post Reply
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Apr 23, 2009 5:17 am

setwhereclause problem

Post by byru » Thu Apr 23, 2009 5:34 am

hi all
i've been working with wxdbtable

and i have a problem in setwhereclause

here is my code:
tbReservasi->SetWhereClause(wxT("DATE = '04/23/2009'"));

if (!tbReservasi->Query())
the result is always error

n here is the table coldefs :
SetColDefs ( 0,wxT("TICKET"),DB_DATA_TYPE_VARCHAR,ticket, SQL_C_WXCHAR,sizeof(ticket),true,true);
SetColDefs ( 1,wxT("DATE"),DB_DATA_TYPE_DATE,&date, SQL_C_DATE,sizeof(date),false, true); // Primary index
SetColDefs ( 2,wxT("TIMESLOTNO"),DB_DATA_TYPE_INTEGER, &timeslotno, SQL_C_UTINYINT,sizeof(timeslotno),false,true);
SetColDefs ( 3,wxT("NIM"),DB_DATA_TYPE_VARCHAR,nim, SQL_C_WXCHAR,sizeof(nim),false,true);
SetColDefs ( 4,wxT("RESERVASISTATUS"), DB_DATA_TYPE_INTEGER,&reservasistatus, SQL_C_UTINYINT,sizeof(reservasistatus),false,true);
i use access database

thx a lot before :)

In need of some credit
In need of some credit
Posts: 3
Joined: Mon May 11, 2009 7:22 pm

Post by Attention » Sun Aug 09, 2009 4:09 am

The date format is your problem.

Turn on ODBC tracing / logging from your
ControlPanel -> Administrative Tools -> Data Sources -> Tracing

You should see the exact complaint in that log file.

Take care!

Post Reply