vb当前记录集不支持更新
运行后不能更新,显示“实时错误3251,当前记录集不支持更新,这可能是提供程序的限制,也可能是锁定类型的限制”请高手帮忙看下谢谢Text1(7).Text=Operate...
运行后不能更新,显示“实时错误3251,当前记录集不支持更新,这可能是提供程序的限制,也可能是锁定类型的限制”
请高手帮忙看下
谢谢
Text1(7).Text = Operater1
'----------给进库表增加信息
Set cn = New Connection
Set rs = New Recordset
sql1 = "select * from instorehouse"
con = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
cn.Open con
Set rs = cn.Execute(sql1)
With rs
.AddNew
.Fields(0) = Text1(0)
.Fields(1) = Text1(1)
.Fields(2) = Text1(2)
.Fields(3) = Text1(3)
.Fields(4) = Date
.Fields(5) = Text1(5)
.Fields(6) = Text1(6)
.Fields(7) = Text1(7)
.Fields(8) = Text1(8)
.Fields(9) = rk
.Update
End With
Call list1disp
'--------------------
'----------给库存表增加信息
stock.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 编号 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
stock.Refresh
If stock.Recordset.EOF = True Then
With stock.Recordset
.AddNew
.Fields(0) = Text1(0).Text
.Fields(1) = Text1(1).Text
.Fields(2) = Val(Text1(2).Text)
.Fields(3) = Text1(3).Text
.Update
End With
Else
With stock.Recordset
.Fields(2) = .Fields(2) + Text1(2)
.Update
End With
End If
'--------------------
'----------给出库表增加信息
outstorehouse.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 编号 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
outstorehouse.Refresh
'--------------------
Call clearzore
Text1(4) = Date
Text1(7) = Operater1
Text1(0).SetFocus
End Sub 展开
请高手帮忙看下
谢谢
Text1(7).Text = Operater1
'----------给进库表增加信息
Set cn = New Connection
Set rs = New Recordset
sql1 = "select * from instorehouse"
con = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"
cn.Open con
Set rs = cn.Execute(sql1)
With rs
.AddNew
.Fields(0) = Text1(0)
.Fields(1) = Text1(1)
.Fields(2) = Text1(2)
.Fields(3) = Text1(3)
.Fields(4) = Date
.Fields(5) = Text1(5)
.Fields(6) = Text1(6)
.Fields(7) = Text1(7)
.Fields(8) = Text1(8)
.Fields(9) = rk
.Update
End With
Call list1disp
'--------------------
'----------给库存表增加信息
stock.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 编号 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
stock.Refresh
If stock.Recordset.EOF = True Then
With stock.Recordset
.AddNew
.Fields(0) = Text1(0).Text
.Fields(1) = Text1(1).Text
.Fields(2) = Val(Text1(2).Text)
.Fields(3) = Text1(3).Text
.Update
End With
Else
With stock.Recordset
.Fields(2) = .Fields(2) + Text1(2)
.Update
End With
End If
'--------------------
'----------给出库表增加信息
outstorehouse.RecordSource = "select * from stock where 品名 ='" + Trim(Text1(0)) _
+ "' and 编号 = '" + Trim(Text1(1).Text) + "'" '查找库中是否有该物品
outstorehouse.Refresh
'--------------------
Call clearzore
Text1(4) = Date
Text1(7) = Operater1
Text1(0).SetFocus
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询