Not sure if this is a coding issue or a linking issue - it's a bit of both, but any ideas would be appreciated:
I have a stand-alone (C++ Builder 6) application which adds records to a "queue" table in a separate back-end MDB file using ADO. Then I have an Access 2K front-end user application which processes (and ultimately deletes) these records. At present this FE app uses DAO, and has worked fine for months at many sites.
However, just lately, a few sites are using more than one PC to run the front-end app, linked to the same back-end queue table to process it. At some (not all) of such sites, we have started to get file corruption of the back-end MDB queue file - "Unrecognised database format" errors. In some cases the corruption was fixable by opening and repairing the table in Access, in others not.
So my first question is this: any ideas why we might be getting this file corruption?
I've been reading around the subject of corruption, and I have done various checks of MDAC version levels etc. and I'm trying to piece together an evidence list to see what the common factors might be between the troublesome sites.
Another thought was that having DAO and ADO both accessing the same file in a multi-user way might be causing the problem, so I've been re-coding the FE app to use ADO instead. And this has led to another weird issue:
In the code I have a DAO recordset being opened on a query. The query left-joins two tables on just one field. At some point in the code, it calls Rs.Delete which deletes the record from the left hand table - which was the desired result. However, now that I have changed this to ADO, the call to Rs.Delete deletes the records from BOTH the tables in the query - which is not the desired result. This got me thinking about what I really would expect to happen when you delete a record from a query with a join in it, so I ran the same query directly in Access and then deleted a row from the query's form view, and (lo and behold) it only deletes the record from the left hand table. However, this is, of course, going to be using DAO, so I guess it's no real surprise.
Any ideas why ADO should be behaving differently? Or am I doing something wrong?
I have a stand-alone (C++ Builder 6) application which adds records to a "queue" table in a separate back-end MDB file using ADO. Then I have an Access 2K front-end user application which processes (and ultimately deletes) these records. At present this FE app uses DAO, and has worked fine for months at many sites.
However, just lately, a few sites are using more than one PC to run the front-end app, linked to the same back-end queue table to process it. At some (not all) of such sites, we have started to get file corruption of the back-end MDB queue file - "Unrecognised database format" errors. In some cases the corruption was fixable by opening and repairing the table in Access, in others not.
So my first question is this: any ideas why we might be getting this file corruption?
I've been reading around the subject of corruption, and I have done various checks of MDAC version levels etc. and I'm trying to piece together an evidence list to see what the common factors might be between the troublesome sites.
Another thought was that having DAO and ADO both accessing the same file in a multi-user way might be causing the problem, so I've been re-coding the FE app to use ADO instead. And this has led to another weird issue:
In the code I have a DAO recordset being opened on a query. The query left-joins two tables on just one field. At some point in the code, it calls Rs.Delete which deletes the record from the left hand table - which was the desired result. However, now that I have changed this to ADO, the call to Rs.Delete deletes the records from BOTH the tables in the query - which is not the desired result. This got me thinking about what I really would expect to happen when you delete a record from a query with a join in it, so I ran the same query directly in Access and then deleted a row from the query's form view, and (lo and behold) it only deletes the record from the left hand table. However, this is, of course, going to be using DAO, so I guess it's no real surprise.
Any ideas why ADO should be behaving differently? Or am I doing something wrong?