By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

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

P: n/a
I want update one record ,but I can't ,why?

code like following:

##-------------------------------------------------
import win32com.client as wc

def main():
conn = wc.Dispatch(r'ADODB.Connection')
rs = wc.Dispatch(r'ADODB.Recordset')
connStr = "Provider=MSDAORA.1;Password=jmpower;User
ID=jmpower;Data Source=jmgis_agps3;Persist Security Info=True"
tblName = r'wjtmp'

conn.Open(connStr )

rs.Open( tblName, conn, wc.constants.adOpenKeyset,
wc.constants.adLockOptimistic )

if rs.Supports( wc.constants.adUpdate ):
rs.Fields.Item(0).Value = 11
rs.Update()
else:
print "recordset can't update"

rs.Close()
conn.Close()

if __name__ == '__main__':
main()
##-------------------------------------------------
thanks!
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.