dim g_conn as new adodb.connection dim l_rs as new adodb.recordsetg_conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=ES103"g_conn.Openl_rs.CursorLocation = adUseClient l_rs.Open "select * from jobs", g_conn, adOpenDynamic, adLockOptimistic set datagrid1.datasource=l_rs1_rs.open "update table set cola='1222'"
g_conn.Execute "update table set cola='1222'"
你的问题不是很清楚呀 修改什么呀 如果是修改记录集 就不要 rs.addnew
直接用 rs.update
CN..Execute "update 表名 set 列名=XX where 条件"
用sql语句 rs.open "update TableName set Col=Value where "
dim l_rs as new adodb.recordsetg_conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=ES103"g_conn.Openl_rs.CursorLocation = adUseClient
l_rs.Open "select * from jobs", g_conn, adOpenDynamic, adLockOptimistic
set datagrid1.datasource=l_rs1_rs.open "update table set cola='1222'"
如果是修改记录集
就不要 rs.addnew
直接用 rs.update
rs.open "update TableName set Col=Value where "