Yes, first I get a Recordset, then I split it into DatabaseRecords. I’ve some classes with a method ( deserializeFromDbRecord(nDr As DatabaseRecord ) that populates its properties with the values of the fields of the DatabaseRecord assigned.
Everything is working fine except the fields of date format.
@Tim Hare : I’ve probably not explained well, my english is limited. I use the databaseRecords contained in a RecordSet to populate the properties of an instance of a bussines model class. The instances of these custom classes are the storage mediums.
@Eugene Dakin : Thanks Eugene, I’ve explored that solution, but it doesn’t work for me in this case, it’s very confused.
In theory myDatabaseRecord.DateColumn(“myDateField”) must returns a Date object, but in the inspector it seems to return a double (probably TotalSeconds, as you indicate). When I try those codes the debugger returns the next exceptions or compilation errors:
Dim myDate As Date
myDate = myDatabaseRecord.DateColumn("myDateDbField") // UnsupportedFormatException, according to the documentation, this should work.
Dim myDate As New Date
myDate.TotalSeconds = myDatabaseRecord.DateColumn("myDateDbField") // Type mismatch error, expected double but got date
Dim myDate As New Date
myDate.TotalSeconds = myDatebaseRecord.DateColumn("myDateDbField").TotalSeconds // UnsupportedFormatException
Thanks @Jym Morton I retrieve a date value from a RecordSet without troubles in others parts of my apps, but in this case I need to do it at DatabaseRecord level. It is working fine for all field types except for date types, returning the errors that I indicate in the previous message.
I had to read your reply several times. A recordset doesn’t contain a databaserecord. It does contain databasefields. If you’re pulling a value out of the recordset, use DatabaseField.DateValue.