Bug #4220 Some ADO features work as if the database were readonly but it isn't
Submitted: 19 Jun 2004 18:58 Modified: 30 May 2013 11:56
Reporter: Manuel Sandoval Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51 OS:Windows (windows)
Assigned to: CPU Architecture:Any

[19 Jun 2004 18:58] Manuel Sandoval
Description:
I have some code for modifying the test database. For example, assuming I opened it with full access and I want to add a row to a table or modify a field, I would use the code below. However, it works as if the database were readonly.

How to repeat:
//Open Test database
CDaoDatabase m_database;
m_database.Open("",false,
          false,"ODBC;Driver={MySQL ODBC 3.51 Driver};");  m_Info="DSN MySQL";}
CDaoRecordset *m_rs = new CDaoRecordset(&m_database);
m_rs->Open(AFX_DAO_USE_DEFAULT_TYPE,"SELECT * FROM table1");		

//Update a cell:
int col=2;
CString val="something new"; 
m_rs->MoveFirst();
for(int i=1;i<row;i++)m_rs->MoveNext();
m_rs->Edit();
m_rs->SetFieldValue(col,(LPCTSTR)val);	
m_rs->Update();

//Insert a row:

m_rs->AddNew();
m_rs->Update();

When Updating data the database is not updated by ADO commands. I have to use directly an ADO Execute statement (m_database.Execute(m_SqlSt)).
When adding/deleting rows, I get "Database or object is readonly", but it isn't.
Is this a bug?
[29 Jun 2004 19:41] Manuel Sandoval
This is using MS VisualC++ 5.0 MFC CDaoDatabase and CDaoRecordset Clases.
[29 Jun 2004 20:15] MySQL Verification Team
I assume your recordset is dbForwardOnly and isn't updatable
using another type of recordet like snapshot isn't supported
due the server don't has native cursors, something will be
introduced in the branch 5.X.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 2013 11:56] Bogdan Degtyariov
Thank you for your bug report. This issue has already been fixed in the release version of that product, which you can download at

  http://www.mysql.com/downloads/