Hi all,
have been programming in Access for many years and yesterday something that left me puzzled happened.
Am running a FE / BE database application on MSAccess 2000 (nope, am not upgrading ). One backend and about 3 FE running (some others are temporarily added for short times).
Am using DAO recordsets to write and read emails text that will later be used to send data updates. Records are opened and then single fields are assigned or read from.
Example:
Code:
Dim rst As Recordset
..
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("clients", dbOpenDynaset)
..
For Each OlMail In OlItems
..
rst.AddNew
..
'gets the text after 'fieldname1:' and returns a string
rst.Fields![fieldname1] = getValStr(textmsg, "fieldname1:")
..
It worked well for months. Yesterday, for unknown reason, the .fields! method instead of writing the value in fieldname1 tried to write it in fieldnameK.
This was quite clear as (sheer luck) the fieldnameK field happened to be very short, not long enough to be assigned the returned string and thus causing an error. Plus its default value was 'IT' and that showed up when i monitored the values in debugging.
Quite puzzled about HOW that happened (messed up pointers in Access?) I tried to recompile the module and voilà. Everything went back to normal.
This morning the same problem happened with a read operation (reading from fieldnameK instead of fieldname1) and messed up data.
As the other FE were working fine I just copied one of them on the offending machine and everything worked smoothly.
While I keep the 'messed up' FE for investigations am quite puzzled about what happened. And worried. What if a wrong field was addressed and the error was not immediately showing?
So my question (sorry for long post) is: has something like this occurred to you? do you have suggestions about what may be the cause?
If it may help the database is quite big (about 200 MB of BE data) and the particular table has many fields (about 40, wouldnt be productive to separate them) but not so many records (about 5000).
It seems an issue of bad pointer but what is causing it?
Regards