SQL Server: update fails, read only cursor! 
Author Message
 SQL Server: update fails, read only cursor!

does anybody has the follwing problem and has a solution for it?

I am  trying to do a simple update or addnew  of a table on my SQL
server 6.5 using RDO but I always get an ODBC error message telling that
its a "read only cursor".
I am using "sa" as login and all table permissions on the SQL server
seem to be ok, so why is it not possible to change data in that table.
It is working fine with e.g. "publishers" table in the "pubs" database
but when I try it with another table in another databse created by me or
even a copy of "publishers" in "pubs" (using SELECT INTO ...) it fails
again!

( I have already found other postings in dejanews and some responses to
that suggesting that the reason is that you must have a primary key in
order to do an update. I still get that error! )

Thank you for your replies.

Dilshad Salim



Fri, 25 Aug 2000 03:00:00 GMT  
 SQL Server: update fails, read only cursor!

You must have a primary key or unique index on the table. You must specify a
resultset type and lock type in the OpenResultset method.

Regards,
Simon Jones
PC Pro Magazine



Fri, 25 Aug 2000 03:00:00 GMT  
 SQL Server: update fails, read only cursor!

If you're going to be doing much in RDO, I =strongly= recommend buying Bill
Vaughn's book "The Hitchhikers Guide to VB and SQL Server".  It discusses
RDO in detail.

As to your specific problem, yes, you must have the primary key of the tably
you're updating in the cursor set; however, judging from what you've said,
that would appear to not be the problem in this case.  The next item is to
make sure that you change the default locking option, with is Concurrent
Read-Only.  These can be changed in the OpenRecordset or the query def.
Search the VB help (with RDO Referenced in your project) for Concurrency and
you should find some reasonable help.

Rob



Fri, 25 Aug 2000 03:00:00 GMT  
 SQL Server: update fails, read only cursor!

Thank you very much Rob Vieira and Simon Jones from PC Pro Magazine for
your responces.
Your advice was helpful. Yes, the reason why I was not able to do
updates on my test table was that my table was indeed lacking a primary
key or a unique index.
My fault was that I had made a copy of the table "publishers" from the
"pubs" databse using " SELECT INTO .." and I was assuming that this was
going to copy the data and the "structure" of the table like I had
learned before but this seems not to be true. Only the data and field
types are copied but no keys, constrains etc.

regards

Dilshad Salim

Quote:

> If you're going to be doing much in RDO, I =strongly= recommend buying Bill
> Vaughn's book "The Hitchhikers Guide to VB and SQL Server".  It discusses
> RDO in detail.

> As to your specific problem, yes, you must have the primary key of the tably
> you're updating in the cursor set; however, judging from what you've said,
> that would appear to not be the problem in this case.  The next item is to
> make sure that you change the default locking option, with is Concurrent
> Read-Only.  These can be changed in the OpenRecordset or the query def.
> Search the VB help (with RDO Referenced in your project) for Concurrency and
> you should find some reasonable help.

> Rob



Sun, 27 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. SQL Server: update fails, read only cursor!

2. SQL Server: update fails, read only cursor!

3. ADO SQL Server updating cursors

4. Error 10095 with SQL Server 6.5 and updates with cursors

5. VB/SQL Server - "Failed Update"

6. BUG: Visual Basic 6.0 T-SQL Debugger Fails Against SQL Server 2000 Named Instance (Q310647)

7. 2nd SQL Server update after update text field corrupts row - using RDO

8. add records to access table fails with back cannot update read-only database

9. doing updating from grid to sql server with stored procedure sql 2000

10. Using RDO to do SQL updates on SQL Server 6.0

11. Problem on SQL-Update Statement with a Data-Control in VB 5 and SQL Server 7.0

12. Update SQL Syntax to Access and SQL Server

 

 
Powered by phpBB® Forum Software