|
From: GT on 16 May 2008 05:41 I have an access database (standalone, single user Windows EXE). There are about 20 or so tables in the database and I'm setting up CDaoRecordSet classes to talk to the database - one recordset per table. All tables/recordsets work perfectly except 1. I have a table called "TEreportsettings", which simply fails when I open it (exactly the same was as all other recordsets)... CDAORecordset_ReportSettings recordSet1(dbase); try { recordSet1.Open(dbOpenTable); etc... The open method (in daocore.cpp) runs normally almost to the end, but in the final 'try - catch' loop, it calls BindFields(); then GetDataAndFixupNulls(). BindFields works IK, but the GetDataAndFixupNulls(); operation calls GetRows which fails, returning code -2147217406, which turns into a DaoException, "GetRows failed. The requested column is not a member of this recordset". This all sounds pretty obvious - its trying to access a field in the table that is not there, only this isn't the case - the RecordSet class has been generated using the class wizard. I have generated it twice to be sure and all the fields are correct - the BindFields() method proves this as it completes normally! I can't find any help on this online and the MSDN is such a huge, badly organised/indexed resource that I can't find anything in there either. I googled the error message and found this page: http://support.microsoft.com/kb/139994, but it seems to suggest that the error message means that I'm adding a table name qualifier to a column name, but I'm not doing that anywhere in any of my recordset classes. Any pointers/ideas would be great thanks.
From: GT on 16 May 2008 06:00 "GT" <ContactGT_removeme_(a)hotmail.com> wrote in message news:014bdd32$0$23721$c3e8da3(a)news.astraweb.com... >I have an access database (standalone, single user Windows EXE). There are >about 20 or so tables in the database and I'm setting up CDaoRecordSet >classes to talk to the database - one recordset per table. All >tables/recordsets work perfectly except 1. I have a table called >"TEreportsettings", which simply fails when I open it (exactly the same was >as all other recordsets)... Cancel my cry for help - found it at last. After 2 days of searching I have gone through all the 'autogenerated' field names (AGAIN) in the DoFieldExchange operation in the recordset and there is a tiny typo. I have no idea how as I didn't type that, but one of the field names has an incorrect word in its name - I generated the recordset class using the MFC ODBC Consumer wizard and haven't changed it! I even generated the class twice to make sure I hadn't accidentally changed something!
|
Pages: 1 Prev: CMFCDesktopAlertWnd Next: VIRUS ALERT! (was CInternetSession::OpenURL and Seek, Read) |