CRecordset insert problem
-
I have a stored procedure which inserts data to table and returns id of inserted data. When I tried to execute procedure using CRecordset open method , i got exception because recordsets can only do selection (readonly). But I saw that Addnew and Update methodes can be used to ınsert new data using recordset. Is there any workaround for open method to execute inserts?
-
I have a stored procedure which inserts data to table and returns id of inserted data. When I tried to execute procedure using CRecordset open method , i got exception because recordsets can only do selection (readonly). But I saw that Addnew and Update methodes can be used to ınsert new data using recordset. Is there any workaround for open method to execute inserts?
Bilge Kaan wrote:
i got exception because recordsets can only do selection (readonly).
Take a look at the parameter
dwOptions
of CRecordset::Open[^]. I'm suspecting that you're probably opening it withCRecordset::readOnly
flag, while you must be opening it withCRecordset::none
orCRecordset::appendOnly
(depending on your needs)It is a crappy thing, but it's life -^ Carlo Pallini
-
I have a stored procedure which inserts data to table and returns id of inserted data. When I tried to execute procedure using CRecordset open method , i got exception because recordsets can only do selection (readonly). But I saw that Addnew and Update methodes can be used to ınsert new data using recordset. Is there any workaround for open method to execute inserts?