Try using this syntax in your sql map:

  #DateOfSubmission:Date#, #DateCleared:Date#

I agree it would be nice for System.DateTime objects to be
automatically mapped to normal Date/Time columns in Access. I think
Roberto and I had a conversation about this a long time.
Mail-archive.com doesn't seem to have any archives of the user-cs list
when it was on incubator :-(

--- Bjorn I <[EMAIL PROTECTED]> wrote:

> I am using Access 2003, and my dates are set to
> general date.
> Statement:
> INSERT INTO Tagout (PartID, DateOfSubmission,
> DateCleared) VALUES (#PartID#, #DateOfSubmission#,
> #DateCleared#)
> I set parameterClass to a value object that contains
> all the fields, and DateOfSubmission and DateCleared
> are both DateTime. I populate the VO and set the dates
> using DateTime.Now. I use the insert method ->
> Mapper.Instance().Insert("InsertTagout", tagoutVO);
> and pass in the VO. I tried setting it to
> DateTime.Now.Date and it works, but then I loose any
> time information. 
> 
> --- Ron Grabowski <[EMAIL PROTECTED]> wrote:
> 
> > I use IBatisNet, DateTime objects, and Access. Could
> > you post the
> > <statement> you're using and how its being called?
> > I'm using Access
> > 2002. The Format drop down is set to nothing.
> > 
> > If you are using Access to store just the date, have
> > you tried passing
> > in the .Date property of the DateTime object?
> > 
> >  map["StartDate"] = startDate.Date;
> > 
> >  ExecuteUpdate("update", map);
> > 
> > --- Bjorn I <[EMAIL PROTECTED]> wrote:
> > 
> > > I also tested the tutorial that came with 1.2.1
> > for
> > > the .Net version. If you set the birthdate in the
> > > PersonInsertDelete method in PersonTest.cs it also
> > > fails with the same error.
> > > 
> > > 
> > > 
> > > --- Bjorn I <[EMAIL PROTECTED]> wrote:
> > > 
> > > > After I updated from 1.1 to 1.2.1 I recieved
> > this
> > > > error while trying to insert a record:
> > > > System.Data.OleDb.OleDbException: Data type
> > mismatch
> > > > in criteria expression.
> > > > Server stack trace: 
> > > >    at
> > > >
> > >
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
> > > > hr)
> > > > 
> > > >    at
> > > >
> > >
> >
>
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
> > > > dbParams, Object& executeResult)
> > > > 
> > > >    at
> > > >
> > >
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> > > > executeResult)
> > > > 
> > > >    at
> > > >
> > >
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> > > > behavior, Object& executeResult)
> > > > 
> > > >    at
> > > >
> > >
> >
> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> > > > behavior, String method)
> > > > 
> > > >    at
> > > > System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
> > > > 
> > > >    at
> > > >
> > >
> >
>
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteInsert(IDalSession
> > > > session, Object parameterObject)
> > > > 
> > > >    at
> > IBatisNet.DataMapper.SqlMapper.Insert(String
> > > > statementName, Object parameterObject)
> > > > 
> > > > The field in question is a Date field. It's set
> > as
> > > > General Date in the access DB, and the passed in
> > > > value
> > > > is DateTime.Now. This used to work fine with
> > 1.1. 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > > protection around 
> > > > http://mail.yahoo.com 
> > > > 
> > > 
> > > 
> > > 
> > >           
> > >
> > ____________________________________________________
> > > Start your day with Yahoo! - make it your home
> > page 
> > > http://www.yahoo.com/r/hs 
> > >  
> > > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Reply via email to