# Re: ADO Addnew and Edit Problem!

Posted by 煮面 on August 04, 1999 at 23:53:09:

In Reply to: ADO Addnew and Edit Problem! posted by lairtec on August 04, 1999 at 23:48:47:

: 小弟在 DataEnviroment 中己设好一有两个参数的 SQL 命令,在 vb 中 open
: 该命令, 并将所得资料指定给一 Recordset 变数(rsVData).

: With deMeasData.rssqlVDATA
: If .State <> adStateClosed Then
: .Close
: End If
: deMeasData.Commands("sqlVDATA").Parameters(0) = Val(cCtrlID(i))
: deMeasData.Commands("sqlVDATA").Parameters(1) = Now
: .Open
: Set rsVData = .Clone
: End With

: 此后对 rsVData 新增纪录后, 若再修改则会出现'最后数值己更新...'的错误

: rsVData.addnew
: rsVData.Fields(0).value = "TEST"
: rsVData.Fields(0).update

: rsVData.Fields(0).value = "MODIFY"
: rsVData.Fields(0).update
: 此时即出现错, Why??

: 若能解惑, 感激不尽!!

将 rs的 Cursor Location 设为 adUserServer即可!

Follow Ups:

- Re: ADO Addnew and Edit Problem! Arthur 13:22:09 8/05/99 (0)