Recordset - Edit - DateValue - entered as StringValue?

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.

rs.Field("A_Date_Field").StringValue = "2013-06-20"

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"

This works: (rs is a Recordset)

rs.Field("A_Date_Field").StringValue = "2013-06-20"

this doesn’t:

rs.Field("A_Date_Field").DateValue = "2013-06-20" or rs.Field("A_Date_Field").DateValue.SQLDate = "2013-06-20"

Is the DateValue method of the recordset for retrieval purposes only?

DateValue is a method, not a date. It accepts a date, not a string.

dim d as new date
rs.Field("A_Date_Field’).DateValue = d