Hi,
i'm currently working with database and i have a problem to find a date record...
i know that to find a record in a DAO object we must use "find" instruction, in fact it works with Text and numeric fields but it doesn't work for Date fields
Here it si my code:
CDaoRecordset pRecordset;
char *pRow;
char d[256];
long year=2004;
long month=1;
long day=8;
COleDateTime COleData_i(year,month,day,0,0,0);
strcpy(d,COleData_i.Format("%m/%d/%Y");
sprintf(pRow,"Date = '%s'", d);
bool check=pRecordset.Find(AFX_DAO_FIRST,pRow);;
if (!check)
{
log_file("record not find..."
}
thanks for any suggestions...
Davide
i'm currently working with database and i have a problem to find a date record...
i know that to find a record in a DAO object we must use "find" instruction, in fact it works with Text and numeric fields but it doesn't work for Date fields
Here it si my code:
CDaoRecordset pRecordset;
char *pRow;
char d[256];
long year=2004;
long month=1;
long day=8;
COleDateTime COleData_i(year,month,day,0,0,0);
strcpy(d,COleData_i.Format("%m/%d/%Y");
sprintf(pRow,"Date = '%s'", d);
bool check=pRecordset.Find(AFX_DAO_FIRST,pRow);;
if (!check)
{
log_file("record not find..."
}
thanks for any suggestions...
Davide