![]() |
|
#1
|
|||
|
|||
CRecordset is read-only when set to snapshot???Hi guys. I'm having a problem with CRecordset. Everything works (read, update, append) fine when I use the 'dynaset' option but I need to use the static option. But if I set the class to use that type in it's construtor, I always get an error that the database is read-only when trying to edit or add records which is rubbish.
I've traced the code and both the database (SQL Server) and CDatabase object are NOT readonly. It's just that the recordset always is when set to snapshot. According to MSDN, both dynaset and snapshot recordsets can be written to so I don't get what I'm doing wrong. You can reproduce this behaviour using the wizard - create an SDI app with an ODBC database and try to add or edit records. Am I missing something? |
|
#2
|
||||
|
||||
Re: CRecordset is read-only when set to snapshot???I'll have to double check the SDI-ODBC thing, but I generally regard snapshots like a view -- as not being updatable. [ I know what you claim from the MSDN, though ], but this is what M$ has in my help, note the underlined portions:
Quote:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: CRecordset is read-only when set to snapshot???I'm not using a Jet database - I'm using SQl server. The MSDN docs do emphasize in several places that non-Jet snapshots can be updated. The only difference is that snapshots have to be requeried to pick up changes to the table, whereas dynastes will show the new record when you move to it.
Thanks for your response anyway. A lot of people have claimed that snapshots cannot be updated but they CAN! So it's either a MS bug/misprint, or we're missing something. I guess people just tried it and when it didn't work, concluded that it wasn't supposed too... |
|
#4
|
||||
|
||||
Re: CRecordset is read-only when set to snapshot???Good, since I also have SQL server, if I get a chance [might be this weekend, though], I'll try it out.
Note that I've also come across other texts that claim snapshots are NOT updatable because of their nature of being "a moment in time", and the snapshot has to be requeried to reflect any changes that might have been made since the snapshot was taken. This will be a good experiment. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| Re: Things to Avoid in C/C++ -- gets() , Part 1 | WaltP | C Programming Language | 5 | 21-Jun-2007 13:13 |
| How to read the data as a whole string? | blue1988tx | C++ Forum | 6 | 28-May-2007 20:08 |
| php.ini file not being read | ian111 | Apache Web Server Forum | 1 | 29-Jun-2005 12:35 |
| Scripts not being read... | amneziac85 | Apache Web Server Forum | 2 | 26-Jan-2004 06:42 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The