Just querying the process regarding the updating of dates via the Recordset (.edit .update) method. Is it correct when saving a date to a date field of a database (Access in my case but I’m assuming any database) that the date is first formatted or converted to a string value and then applied or used within the Recordset updating process? The following line of code works but this was after some trial and error as I couldn’t get the recordset field .DateValue to play the game.
As mentioned the above works but initially I was attempting to utilise the .DateValue (and .SQLDate) of the Recordset field but to no avail. Do we not use the .DateValue of a recordset field to update a date?
Yes I do use the Date Datatype when my Objects write Dates in Databases but when talking about NIL or NULL values I pass strings to be for sure what I am writing. I’ve experienced some strange issues with different DBMS, some use 0101.1970, other 01.01.1901 and some 0000-00-00 for instance.
if self.BirthdayAt <> nil then rs.DateColumn("BirthdayAt") = self.BirthdayAt else rs.Column("BirthdayAt") = "0000-00-00 00:00:00"