I am having a problem with a DA class that I am writing. My problem seems to be stemming from when I try to put a date object into an Access database datetime field.
I believe it is a problem with my insert sql statement. Here it is.
My code compiles, but when I try to run it, I am getting an error when I try to run my TestSectionConnection class.
Problems with query/update : [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#11/31/-1898#'.
Press any key to continue...
I dont get where it is getting the date 11/31/-1898. It seems like it is getting bad data in part of the date object. Would not setting pieces of the date object when I put it into the database cause this error?
I have included my section da classes and my Access database in a zip file at the bottom of this post so you can look at it if you want to. I can post the code if you would rather read it here instead of getting it from the zip file. Any input is helpful. THanks
Do a few System.out.println statements throughout your program and find out exactly WHERE this date is being set to an unreal year. I highly doubt putting it into the database will cause this error. I'm guessing you are doing some calculations and constructing the date elsewhere in your program, which is where the problem is probably occuring.
Do a few System.out.println statements throughout your program and find out exactly WHERE this date is being set to an unreal year. I highly doubt putting it into the database will cause this error. I'm guessing you are doing some calculations and constructing the date elsewhere in your program, which is where the problem is probably occuring.
I agree with "System_Error".
Another thing, if you are using an IDE it'd be a good idea to use breakpoints and trace the date value.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson My Blog