The problem is not with updating date fields in Access. I re-read my
post and it looks like I was trying to run an update query. That's not
the case. UPDATE/INSERT statements have always worked correctly. The
issue I was describing in my post occured when my code was in the WHERE
clause of a SELECT statement. DateTime.Today might work in this case
becuase I am just working with days but I may need to work with dates
and times in the future. Access only has one type of date field:
Date/Time. It should just work. If I remember correctly, IBatis is just
creating an IDbParameter and setting its .Value. The underlying OleDb
libraries should know how to handle dates...

I always get the feeling like I'm the only developer using iBatis and
Access :(

- Ron

--- "Jarmo Ollikainen [Entegra Oy]" <[EMAIL PROTECTED]>
wrote:
> Ron Grabowski wrote:
> 
> >I'm using the OleDb libraries to connect to an Access database.
> >
> >I recieve the following error:
> >
> > [OleDbException (0x80040e07): Data type mismatch in criteria
> >expression.]
> >
> >The exception occurs when EndDate exists in the Hashtable:
> >
> > map["EndDate"] = DateTime.Now;
> >  
> >
> 
> I once had very similar problem when updating  Date/Time field in
> Access 
> database. If I remember right, my exception occured when I tried to 
> update DateTime object with time part containing other than 00:00:00 
> into Access Date/Time field with "Short Date" format setting.
> 
> Try altering Access field's format to "General Date" or using 
> DateTime.Today instead of DateTime.Now as value to be updated.
> 
> I hope this tip helps.
> 
> Cheers
> 
> Jarmo Ollikainen

Reply via email to