Page 1 of 1

setwhereclause problem

Posted: Thu Apr 23, 2009 5:34 am
by byru
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 :)

Posted: Sun Aug 09, 2009 4:09 am
by Attention
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!