If Text2 = "" Then
MsgBox "请填写完整"
Else
Set db = New ADODB.Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs = New ADODB.Recordset
For i = 1 To 4
rs.Open "select * from mychuhuo where chbianhao=" & i & "", db, adOpenStatic, adLockOptimistic
Label4 = rs("chbianhao")
Label5 = rs("chmc")
Label6 = rs("chsl")
Set db2 = New ADODB.Connection
db2.CursorLocation = adUseClient
db2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs2 = New ADODB.Recordset
rs2.Open "select * from kucun where kpinzhong='" & Label5 & "'", db2, adOpenStatic, adLockOptimistic
If Not rs2.EOF Then
MsgBox "找到" + Label5
If Label6 <= rs2("kshuliang") Then
MsgBox Label5 + "可以出货"
rs.Close
If i = 4 Then
MsgBox "全部检验成功,开始出货"
Set db3 = New ADODB.Connection
db3.CursorLocation = adUseClient
db3.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs3 = New ADODB.Recordset
For q = 1 To 4
'
rs3.Open "select * from mychuhuo where chbianhao=" & q & "", db3, adOpenStatic, adLockOptimistic
Label4 = rs3("chbianhao")
Label5 = rs3("chmc")
Label6 = rs3("chsl") Set db1 = New ADODB.Connection
db1.CursorLocation = adUseClient
db1.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs1 = New ADODB.Recordset
rs1.Open "select * from kucun where kpinzhong='" & Label5 & "'", db, adOpenStatic, adLockOptimistic
db1.Execute "update kucun set kshuliang='" & rs1("kshuliang") - Val(Label6) * Val(Text2) & "' where kpinzhong='" & Label5 & "'"
Print Label4 + " " + Label5 + "...成功-"; Val(Label6) * Val(Text17)
Next q End If
Else
MsgBox Label5 + "库存不够"
Exit For
End If
Else
MsgBox "找不到" + Label5
Exit For
End If
Next iEnd If停在rs3.open
提示数据库打开时不能操作,
求指教,求精简
MsgBox "请填写完整"
Else
Set db = New ADODB.Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs = New ADODB.Recordset
For i = 1 To 4
rs.Open "select * from mychuhuo where chbianhao=" & i & "", db, adOpenStatic, adLockOptimistic
Label4 = rs("chbianhao")
Label5 = rs("chmc")
Label6 = rs("chsl")
Set db2 = New ADODB.Connection
db2.CursorLocation = adUseClient
db2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs2 = New ADODB.Recordset
rs2.Open "select * from kucun where kpinzhong='" & Label5 & "'", db2, adOpenStatic, adLockOptimistic
If Not rs2.EOF Then
MsgBox "找到" + Label5
If Label6 <= rs2("kshuliang") Then
MsgBox Label5 + "可以出货"
rs.Close
If i = 4 Then
MsgBox "全部检验成功,开始出货"
Set db3 = New ADODB.Connection
db3.CursorLocation = adUseClient
db3.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs3 = New ADODB.Recordset
For q = 1 To 4
'
rs3.Open "select * from mychuhuo where chbianhao=" & q & "", db3, adOpenStatic, adLockOptimistic
Label4 = rs3("chbianhao")
Label5 = rs3("chmc")
Label6 = rs3("chsl") Set db1 = New ADODB.Connection
db1.CursorLocation = adUseClient
db1.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source= " + App.Path + "/hengshi.mdb;Persist Security Info=False"
Set rs1 = New ADODB.Recordset
rs1.Open "select * from kucun where kpinzhong='" & Label5 & "'", db, adOpenStatic, adLockOptimistic
db1.Execute "update kucun set kshuliang='" & rs1("kshuliang") - Val(Label6) * Val(Text2) & "' where kpinzhong='" & Label5 & "'"
Print Label4 + " " + Label5 + "...成功-"; Val(Label6) * Val(Text17)
Next q End If
Else
MsgBox Label5 + "库存不够"
Exit For
End If
Else
MsgBox "找不到" + Label5
Exit For
End If
Next iEnd If停在rs3.open
提示数据库打开时不能操作,
求指教,求精简
解决方案 »
- 有没有带有登陆权限的人事管理的代码
- 为什么代码里的DrawText没显示出文字?
- 编了个客户端和服务器端的程序,客户端发送数据,怎么服务器端没反应呢,高手来看看
- 更改图标
- 如何结束存储过程的继续执行?
- vb到c
- 将VB提升为服务后的两个问题 不知发哪就发这了 分不多,有兴趣就看看撒
- C:\Documents and Settings\......\Favorites中文件的Web文档属性
- 有谁用过ChangeDisplaySettings这个API???
- 我想把菜单做成xp风格的,谁有这方面的知识介绍阿
- excel文件的多个sheet拆分成多个excel文件
- excel文件的多个sheet拆分成多个excel文件
if rs3.state<>adstateclosed then rs3.close '<---加上这句
rs3.Open "select * from mychuhuo where chbianhao=" & q & "", db3, adOpenStatic, adLockOptimistic