I want update one record using ADO,but I can't ,why?

Robert Brewer fumanchu at amor.org
Wed Jan 26 01:46:34 EST 2005


nightmarch wrote:
> Sorry, I mean  this code line " rs.Supports( wc.constants.adUpdate ) "
> got False result, So I can't update one record,i.e. I can't execute
> this code "rs.Fields.Item(0).Value = 11".
> 
> And , if code is written like this:
> 
> ##<code-------------------------
>    conn.Open(connStr )
>    rs.Open( tblName, conn, wc.constants.adOpenKeyset,
> wc.constants.adLockOptimistic )
> 
>    rs.Fields.Item(0).Value = 11
>    s.Update()
> ##>code-------------------------
> 
> I got error msg like following:
> 
> ##<errorMsg----------------------------
> self._oleobj_.Invoke(*(args + (value,) + defArgs))
> com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3',
> (0, 'ADODB.Field', 'Current Recordset does not support updating. This
> may be a limitation of the provider, or of the selected locktype.',
> 'C:\\WINNT\\HELP\\ADO210.CHM', 0, -2146825037), None)
> ##>errorMsg----------------------------

Well, without knowing your entire Oracle setup, I'm not sure how far one
can get. My only thought is to try a full SELECT statement instead of
just the tablename, and preface the tablename with the schema, something
like:

"select * from %s.%s;" % (schema, tblName)

It's possible the trailing semicolon is important to close the
statement.

The next thing to check would be permissions.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list