Link to home
Start Free TrialLog in
Avatar of majorjohn
majorjohn

asked on

CDatabase Problem with SQL Server

==> When I am trying to save data by transfering value like m_pSet->m_Name = "sdf" and calling m_pSet->Update() It is giving "RECORDSET IS READ ONLY". The database property has been properly set to allow update,modify,delete etc.

In my SQL Server Database I have set Option checked for APPEND,MODIFY AND DELETE. Pl. see the following :

1) In DOC header class I am declaring an object of CDatabase.(CDatabase mdb)
2) In OnNewDocument() of DOC CPP I am opening the database by
mdb.Open(NULL,FALSE,FALSE, strconnect,.....).
Before that I am creating a new CRecordset Class for my table. and in OnNewDocuement() linking this CRecordset pointer with CDatabase object.

3) Then in OnSave() using
m_Pset->Edit()
m_Pset->m_Name="sfdsdfdsf"
m_Pset->Update()

It is doing everything but only giving Recordset is READONLY.

What to do?


=> Will ExecuteSQL("select * from ab") will be perfectly working in SQL Server as ACCESS ? I am facing some problem of not executing it. What may be the error?
Avatar of tchalkov
tchalkov

The recordset could be readonly, even if you have checked all options.
post your SQL which you use to open the recordset
ASKER CERTIFIED SOLUTION
Avatar of prasanthmj
prasanthmj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial