We are moving our existing VC++ V6 app to .NET using Visual Studio 2005 beta. To save on time we have been able to wrap up a lot of our existing base code into a separate C++ project within the .NET application. The main .NET application uses ADO.NET to connect to our SQL Server DB, the old C++ code uses ODBC via classes derived from the MFC classes, CDatabase and CRecordSet.
We have completed some initial coding of the application and have been able to execute our old C++ dialogs from within the .NET application and can view the correct data in them (returned via CDatabase/CRecordset). However, we have been unable to update any data using the old C++ based dialogs using the classes derived from CRecordSet, the CRecordset derived class we have always returns an exception reporting that the recordset is readonly. This occurs when Edit() is called on our class. Note that this code is proven under our existing VC++ V6 application which can access and update the same table in the same database on the same server with no problems.
I have ensured that there is a primary key on the table, that all permissions are correct and that the CDatabase and CRecordset objects are not being created in readonly mode. Any ideas as to why this is happening

CRecordSet ReadOnly in C++ Dll called from .NET
bldink
nikola
Silliea
I have had some success with this problem now. By openning the CRecordSet as a dynaset I have been able to obtain write access. I still do not know why it should not work as a snapshot. I ddi read somewhere that a snapshot is only read/write if the cursor library is used - which I am doing, so perhaps this is a bug. For now I will continue with the dynaset solution, but would like to know the out come of this problem.
Regards,
R.Beaumont
Brian Hartman - MSFT
Please open a bug on lab.msdn.microsoft.com. Our dev team will take a look. I am suspecting this is a problem in implementation of CRecordSet, in method IsSelectQueryUpdatable in particular. There is a call to memmove() that may be the problem. Anyway our dev team has to investigate this.
Thanks
Nikola
VC++
----------------------
I see you opened a bug, http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx feedbackid=2d64844d-2e9f-467f-a0bd-32185e3890fc
Thanks, we will investigate the issue.
Nikola