Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Date Error causing nightmares

Status
Not open for further replies.

culshaja

Programmer
Aug 10, 1999
705
GB
I am using ADO 2.1 with the Jet 4.0 OLE DB driver.<br>I am using an update command to add a date. The string passed to the command object has the correct date, and when run, does so successfully.<br>However, when looking at the underlying database, the date has been set to December 1899, and it does this for ANY date that is used in the update command.<br>This issue has only started recently. I have Office 97 Service Release 2b on my machine, but other machines that this happens on have Service release 1 or 2a.<br><br>James :) <p>James Culshaw<br><a href=mailto:james_culshaw@activedatasolutions.madasafish.com>james_culshaw@activedatasolutions.madasafish.com</a><br><a href= > </a><br>
 
culshaja,<br>What do you mean 'does so successfully' in regards to the Command object?&nbsp;&nbsp;Obviously, *something* was not successful...the Dec 1899 date is the Zero date for Jet Date types, so somehow the Update command is seeing a 0 in the command string.&nbsp;&nbsp;Can you debug.print the string and see what it's getting?&nbsp;&nbsp;Is there a Default Date for that field, or any validation?<br>--Jim
 
There is no default date or validation for the field. I use the watch window to see at all times what the command object looks like so I know its got the correct data in the command string. By 'successfull' I mean I do not recieve run-time errors.<br>The following string is what is in the command text:<br>&quot;UPDATE episode SET episode.discharge_d = #06-Apr-2000#&nbsp;&nbsp;AND discharge_reason = 3 WHERE (((episode.episode_id)=48));&quot;<br><br>James :) <p>James Culshaw<br><a href=mailto:james_culshaw@activedatasolutions.madasafish.com>james_culshaw@activedatasolutions.madasafish.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top