标题: 这段代码为什末出现"文件共享锁定数溢出3052"错误 [打印本页] 作者: apeng 时间: 2005-5-16 19:11 标题: 这段代码为什末出现"文件共享锁定数溢出3052"错误 Public Function abc()
On Error GoTo Err_Cmdls_Click
CurrentDb.Execute "update 电视剧整理 set 临时=''"
Dim Rs As New ADODB.Recordset
Dim date1 As Date
Dim date2 As Date
Dim str1 As String
Dim str2 As String
Dim xx1 As String
Dim xx2 As String
Dim mc1 As String
Dim mc2 As String
Rs.Open "电视剧整理", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
Rs.MoveFirst
CurrentDb.Execute "update 电视剧整理 set 临时=名称 "
Do Until Rs.EOF
str1 = Rs!临时
date1 = Rs!开始日期
xx1 = Rs!合并
mc1 = Rs!名称
Rs.MoveNext
mc2 = Rs!名称
xx2 = Rs!合并
date2 = Rs!开始日期
If xx1 = xx2 And date2 - date1 > 10 Then
str2 = str1 + "-重"
Rs!临时 = str2
ElseIf xx1 = xx2 And date2 - date1 <= 10 Then
Rs!临时 = str1
Else
Rs!临时 = mc2
End If
Loop
Rs.Close
Set Rs = Nothing
Exit_Cmdls_Click:
Exit Function
Err_Cmdls_Click:
If err.Number = 3021 Then
MsgBox "结果已经生成!", vbInformation, "提示:"
Resume Exit_Cmdls_Click
End If
MsgBox err.Description & err.Number
Resume Exit_Cmdls_Click