PavelGur
Programmer
- Sep 21, 2001
- 75
I have very strange program behavior. In the process of obtaining date period from Access table I'm getting assertion error and not even on every execution of the code. I have try - catch set but it do not give me exception but stops at the table openning.
Here is the code:
szPrevDate = tLastBrkDate.Format("%m/%d/%y");
szCurDate = tCurDate.Format("%m/%d/%y");
szDates = szDatesSelect
+ szPrevDate
+ szDateLast
+ szCurDate
+ szDateOrder;
try
{
pDATE->Open(CRecordset::snapshot, szDates, CRecordset::none);
}
catch(CDBException* e)
{
CString szFunction("pDate->Open");
HandleError(e, szFunction);
return false;
}
The szDates comes as
"select * from Dates where ((Dates.Date)>#03/03/06#) and (Not Dates.Date>#03/10/06#) order by Date"
The dates are in the table and table is fine. It works most of the time. But once in a while give this strange assertion error.
Did anybody had this problem?
Thanks, Pavel.
Here is the code:
szPrevDate = tLastBrkDate.Format("%m/%d/%y");
szCurDate = tCurDate.Format("%m/%d/%y");
szDates = szDatesSelect
+ szPrevDate
+ szDateLast
+ szCurDate
+ szDateOrder;
try
{
pDATE->Open(CRecordset::snapshot, szDates, CRecordset::none);
}
catch(CDBException* e)
{
CString szFunction("pDate->Open");
HandleError(e, szFunction);
return false;
}
The szDates comes as
"select * from Dates where ((Dates.Date)>#03/03/06#) and (Not Dates.Date>#03/10/06#) order by Date"
The dates are in the table and table is fine. It works most of the time. But once in a while give this strange assertion error.
Did anybody had this problem?
Thanks, Pavel.