为什么不能大量更新数据?

qwher 2004-04-02 10:42:47
见程序:

Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "select * from setc where 141000<=userno and userno>=142999 order by userno"
Adodc3.Refresh

Adodc1.Recordset.MoveFirst

Do While Not Adodc1.Recordset.EOF

Adodc3.Recordset.AddNew

Text3(0).Text = Text1(0).Text
Text3(1).Text = Val(Text1(3).Text) + Val(Text1(5).Text)
Text3(2).Text = Val(Text1(4).Text) + Val(Text1(6).Text)

Adodc3.Recordset.Fields("tottc") = 0

'问题出现(开始几条记录没有问题)
Adodc3.Recordset.Update
Adodc1.Recordset.MoveNext
Loop
...全文
23 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
qwher 2004-04-05
  • 打赏
  • 举报
回复
问题解决了!
原程序环境:vb6.0 + vfp5.0 + Win98
现在环境:vb6.0 + vfp5.0 + WinXp

将ADO改为:CursorLocation:adUseserver;
并在程序前加:On Error Resume Next
OK!!!
qwher 2004-04-02
  • 打赏
  • 举报
回复
如:TechnoFantasy(冰儿马甲www.applevb.com) 所说

反复频繁的执行Update是会有问题的。


qwher 2004-04-02
  • 打赏
  • 举报
回复
我程序实现的功能是从一个数据表中取数据形成报表,如程序所示.
uxuan 2004-04-02
  • 打赏
  • 举报
回复
'问题出现(开始几条记录没有问题)
是什么意思,报什么错呢
关键字重了吗
qwher 2004-04-02
  • 打赏
  • 举报
回复
呵呵...我是从一foxpro表取数据到另外一个表
weaest 2004-04-02
  • 打赏
  • 举报
回复
update setc set tottc='0' where 141000<=userno and userno>=142999
43720938 2004-04-02
  • 打赏
  • 举报
回复
Text3(0).Text = Text1(0).Text
Text3(1).Text = Val(Text1(3).Text) + Val(Text1(5).Text)
Text3(2).Text = Val(Text1(4).Text) + Val(Text1(6).Text)

不明白这段代码的意思,你的整个思路都看不明不知道你要实现什么?
qwher 2004-04-02
  • 打赏
  • 举报
回复
请问怎么写这个sql语句呢?
TechnoFantasy 2004-04-02
  • 打赏
  • 举报
回复
反复频繁的执行Update是会有问题的。你为什么不在一个SQL语句里面完成呢?
zjcxc 2004-04-02
  • 打赏
  • 举报
回复
错误提示是什么?
fuanwei 2004-04-02
  • 打赏
  • 举报
回复
update setc set tottc= "& 0 &" where 141000<=userno and userno>=142999
whachun 2004-04-02
  • 打赏
  • 举报
回复
错误信息是什么,
信息全面一点,这样太不清楚了

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧