比较奇怪的问题,以更改但不显示

fzhfeng 2002-12-21 09:54:46
Dim rsPrice As ADODB.Recordset
Set rsPrice = New ADODB.Recordset
Dim strSQL As String
strSQL = "select * from houses where house_ID =" & Val(frmHousesPool.lvwHouses.SelectedItem.Key)

rsPrice.Open strSQL, CN, adOpenDynamic, adLockPessimistic
Dim n
Dim m
n = rsPrice.Fields("house_address")
m = rsPrice.Fields("saling_price")
rsPrice.Fields("saling_price") = 333
rsPrice.Update
Debug.Print rsPrice("saling_price").Value
rsPrice.Close
Set rsPrice = Nothing

/////
Debug.Print 也是333
但是打开数据库确实没有变动的,还是原样
...全文
21 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
laihua 2002-12-22
  • 打赏
  • 举报
回复
是不是adOpenDynamic, adLockPessimistic这个要改一下
goodnow 2002-12-22
  • 打赏
  • 举报
回复
你的CN呢?
开始是如何打开的?
最后应该也关闭一下
饮水需思源 2002-12-21
  • 打赏
  • 举报
回复
rsPrice.Update后再加一句rdprice.refresh试试,
另外,修改数据库建议使用update tablename set field=... where ...
格式 
ozarkgirl 2002-12-21
  • 打赏
  • 举报
回复
推推推

1,216

社区成员

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

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