I my class public function i call the follow :
mptr = new CMyRecordset(&m_db); //mdb is CDatabas
instance
mptr->open(); //I also try to
pass CRecordSet::none ....etc paremeter
But it can't be update and delete.
I have check that mptr->CanUpdate() return FALSE
But i check that mdb.CanUpdate() return TRUE
I also check my database that has all the permission. Why ?
Thank You
The classwizard asks for this parameter (I think)
when creating the recordset class, and it might be
snapshot by default.
/Glenn
Alot of that depends on what database, how many tables are
being joined and how they are joined.
Try using SQL to update the database directly (Or use MS-SQL or
ACCESS or something to represent the SQL) and see if the query is
updatable outside of the context of your CRecordset derived object.
JohnF.
Try stepping into Open() particularly where it builds the SQL.. see if
it is doing anything odd... Otherwise I'm out of ideas.
Cheers,
JohnF.
Don't believe everything you read in books (e.g. Blaszczak).
This also depends on the cursor library you are using. With
SQL Server if you use the ODBC cursor library(the MFC default
for snapshots) it will simulate ROWVAL concurrency and allow
updates through the recordset. Try creating a default snapshot
appwiz project, bind a couple of controls and try editing them.
If you set the CDatabase to use driver cursors ( using a parameter of its
open method), snapshot record
sets use static server side cursors in SQL Server which are
readonly. This make things very confusing!
Another annoying thing is that if your SQL contains outer joins
then the SQL server will change a dynaset(keyset) server
cursor into a static readonly one so you have a situation where
a snapshot is updatable but a dynaset isn't!
My brain hurts.
Regards
Terry Child
--
---------------------------------------------------------
D. W. Hancock Software Development
Pave Tech Inc.
remove ? for correct e-mail. I have been inundated with
too much SPAM.
---------------------------------------------------------