July 2nd, 1999, 09:16 AM
I am developing database application using CDAO classes and MS Access. I defined several querys using dates in the SQL WHERE clauses. All of my querys work fine on the development machine but when I tested on a client machine which only have Window 95 and the DAO dll installed, the application crashed. OH HELP HELP HELP.
Sample query:
PARAMETERS pvdtmStart DateTime;
SELECT dtmVisitDate
FROM Agenda
WHERE dtmVisitDate >= pvdtmStart;
Sample code accessing the query:
CDaoQueryDef qdQuery(poDatabase)
qdQuery.Open(strQuery);
if(mpoParameter)
for(int i = 0; i < mpoParameter->GetCount(); i++)
{
COleVariant * pvarParamValue = (COleVariant)
mpoParameter->GetAt(mpoParameter->FindIndex(i));
qdQuery.SetParamValue(i, pvarParamValue);
}
// This is where it crashes in the client machine
mrsRecordset.Open(&qdQuery, dbOpenDynaset);
...
}
OH HELP HURRY
I pin point the error because of the date in the WHERE clause, other query without a date in the WHERE clause works fine. Anyone have any suggestion on how I should solve this?
Help please,
Ted
Sample query:
PARAMETERS pvdtmStart DateTime;
SELECT dtmVisitDate
FROM Agenda
WHERE dtmVisitDate >= pvdtmStart;
Sample code accessing the query:
CDaoQueryDef qdQuery(poDatabase)
qdQuery.Open(strQuery);
if(mpoParameter)
for(int i = 0; i < mpoParameter->GetCount(); i++)
{
COleVariant * pvarParamValue = (COleVariant)
mpoParameter->GetAt(mpoParameter->FindIndex(i));
qdQuery.SetParamValue(i, pvarParamValue);
}
// This is where it crashes in the client machine
mrsRecordset.Open(&qdQuery, dbOpenDynaset);
...
}
OH HELP HURRY
I pin point the error because of the date in the WHERE clause, other query without a date in the WHERE clause works fine. Anyone have any suggestion on how I should solve this?
Help please,
Ted