|
运行时发生运行时错误“3211”
由于表"345"正被别的用户或进程使用数据库引引擎无法锁定它。
我先前运行过以下代码,其中 456和789为查询,会调用表345,请教如何删除此进程锁定表345
Private Sub Command54_Click()
Dim a As Variant
Dim b As Variant
Dim c As Variant
Dim d As Variant
Dim e As Variant
Dim f As Variant
Dim g As Variant
Dim rst1 As Recordset
Dim rst3 As Recordset
If Me.Combo48 = "" Then
MsgBox "请输入型号"
Else
DoCmd.DeleteObject acTable, 456
DoCmd.OpenQuery "Tact查询", acNormal, acEdit
DoCmd.DeleteObject acTable, 789
DoCmd.OpenQuery "总数查询", acNormal, acEdit
Set rst1 = CurrentDb().OpenRecordset("789")
rst1.MoveFirst
If rst1.EOF = False Then
a = rst1![zs]
Else
a = 0
End If
rst1.Close
a = Int(a * 0.75)
If a <> 0 Then
Set rst3 = CurrentDb().OpenRecordset("456")
rst3.MoveFirst
rst3.MoveNext
b = rst3![Tact]
c = 0
Do
rst3.MoveNext
c = c + 1
If c <= a Then
d = rst3![Tact]
b = b + d
Else
e = b / a
rst3.Close
Exit Do
End If
Loop
Else
e = 0
End If
Me.Text52 = e
End If
DoCmd.Close acQuery, 789
End Sub
[ 本帖最后由 xwwei 于 2008-4-16 10:26 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|