ODBC Error: Operation must use an updatable query. 
Author Message
 ODBC Error: Operation must use an updatable query.

Hello everyone,

I have experienced some problems with the updating of a recordset.
The following code sample illustrates that problem.

                m_MyDatabase.Open( _T( "SAINTS" ) );

                CMyRecordSet set( &m_MyDatabase );
                set.Open();
                set.Edit();
                set.m_Name = "Santaclaus";
                if( set.CanUpdate() )
                {
                        set.Update();  

CommController: Operation must use an updatable query.
CommController: State:S1000,Native:3035,Origin:[Microsoft][ODBC Microsoft
Access 97 Driver]

                }
                set.Close();

So while updating the recordset an exception is thrown. Does anyone
kwnows how this problem can occur and/or how to solve this?

Any help is greatly apppreciated,

Klaas Hoogeboom



Sat, 08 Jul 2000 03:00:00 GMT  
 ODBC Error: Operation must use an updatable query.

It looks like you are doing everything correctly. You could try the
following instead and see if that makes a difference although it shouldn't.

m_MyDatabase.OpenEx(_T("DSN=SAINTS"), CDatabase::useCursorLib);

Calling Open() with the default parameters should load the cursor library by
default. Sometimes whether or not you load the cursor library can make a
difference. In the case of Access, I'm not sure whether you should use the
cursor library or not. I know that with Visual FoxPro, you do need it.

Also, you could try explicitly stating what type of cursor it is that you
want to use when you call CRecordset::Open(). The default is static which
should be fine.

It could be that it wasn't able to create a static cursor for one reason or
another and it is using a cursor type with lesser functionality instead
(e.g. a read only forward scrolling cursor).

Also, make sure that you don't have the Read Only checkbox selected in the
ODBC control panel for the data source.

Jon

--
To reply to me via email please remove the _ from my email address.

Quote:

>Hello everyone,

>I have experienced some problems with the updating of a recordset.
>The following code sample illustrates that problem.

> m_MyDatabase.Open( _T( "SAINTS" ) );

> CMyRecordSet set( &m_MyDatabase );
> set.Open();
> set.Edit();
> set.m_Name = "Santaclaus";
> if( set.CanUpdate() )
> {
> set.Update();

>CommController: Operation must use an updatable query.
>CommController: State:S1000,Native:3035,Origin:[Microsoft][ODBC Microsoft
>Access 97 Driver]

> }
> set.Close();

>So while updating the recordset an exception is thrown. Does anyone
>kwnows how this problem can occur and/or how to solve this?

>Any help is greatly apppreciated,

>Klaas Hoogeboom



Sat, 08 Jul 2000 03:00:00 GMT  
 ODBC Error: Operation must use an updatable query.

After hours of suffering I finaly discovered what caused the problem:

Im my application there are two classes that use the database.
Both classes have a CDatabase attribute and the CDatabase::Open
function is executed in both classes, connecting to the same
datasource.

I solved the problem by supplying the CDatabase attribute of one class
as parameter to the constructor of the other class, so CDatabase open
is called only once.



Sun, 09 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ODBC error: Operation must use an updatable query

2. ACC97 UPDATE error : Operation must use an updatable query

3. must use an updatable query

4. How can I find out, if query is updatable with Jet 4.0 provider in VC++

5. ODBC Error : "Query is too complex"

6. ODBC Error : "Query is too complex"

7. ODBC Error : "Query is too complex"

8. ODBC errors and Query Defs Re-Post

9. ODBC Error : "Query is too complex"

10. Problem with SQL query using Access + ODBC

11. Problem sorting predefined query using ODBC

12. Query db using MFC via ODBC

 

 
Powered by phpBB® Forum Software