We have a legacy C++ app that needs to work with Access 97 mdb files, and uses the CDao classes from MFC. Recently, the need has arisen to make a few changes to this app. But, when I build the project without changes, I am getting errors. Specifically, 0x80041002 from CDaoRecordSet::Open(). The mdb file is present, and has already been updated by the same program, prior to this event. I can't discern any error message. The query looks like this:
SELECT * FROM Rule WHERE ((Product_ID = %d) AND (Section_Level = 0)) ORDER BY Rule_Order ASC
This table contains an AutoNumber field.
What's changed in the development machine? Quite a lot, potentially. XP SP3, Office 2007, IE 7, at a minimum.
Folks, I blush to say that I have found the problem, and that it is within the application. DAO was trying to tell me that I had one fewer columns in my table than I thought I did. Why did it not fail for the users? They have a version older than this bug.
Apologies to anyone who spent time thinking about this.