| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 379 人关注过本帖
标题:当多数据时,为何出现3265错误呢?
只看楼主 加入收藏
QQ342151559
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-10-10
收藏
 问题点数:0 回复次数:1 
当多数据时,为何出现3265错误呢?
程序代码:
Public Function Daily_Alarm_Arr(ByVal str_Date As Variant)
Dim i As Integer
Dim j, l, k As Byte
Dim str_Field As Field
Dim Arr_Field(), str_Data, str_Alarm, str_Modules, str_T  As String
Dim Arr_Data() As Variant
'status,Shift,Tool_Name.Module_Name,Alarm_Name,Action,Operator,Case_ID,Comment_Current,Comment_History  distinct
'B.CaseResult,B.DutyShift,D.ToolID,A.Alarm_Module,A.Alarm_IDs,A.Alarm_Action,B.Sponsor,B.CaseID,B.CaseComment1,B.CaseComment2
Report_Search_TxT = "select B.CaseResult,B.DutyShift,D.ToolID,A.Alarm_Module,A.Alarm_IDs as A_IDs,A.Alarm_Action,B.Sponsor,B.CaseID,B.CaseComment1,B.CaseComment2 from ((Case_Alarm A "
Report_Search_TxT = Report_Search_TxT & "left join Case_Rec B on A.CaseID=B.CaseID) "
Report_Search_TxT = Report_Search_TxT & "left join Case_History C on A.CaseID=C.CaseID) "
Report_Search_TxT = Report_Search_TxT & "left join [;database=" & DataBase_Name_Connect_Info & "].Info_ID_Tool D on D.TypeID=B.Tool_ID "
Report_Search_TxT = Report_Search_TxT & "where C.Update_Time= '" & str_Date & "' "
Report_Search_TxT = Report_Search_TxT & "order by B.CaseResult,B.DutyShift,B.Tool_ID"
'str_Judge, "Record_History", DataBase_Type, "Y"
Set DB_Rs = WIS_Connect(Report_Search_TxT, "Record_History", DataBase_Type)
k = 0
ReDim Arr_Field(9)

For Each str_Field In DB_Rs.Fields
'  If Not IsNull(str_Field.Value) Then
     Arr_Field(k) = str_Field.Name
'  End If
  k = k + 1
  DoEvents
Next

Report_Daily_Alarm_Count = DB_Rs.RecordCount
If Report_Daily_Alarm_Count = 0 Then
    ReDim Report_Daily_Arr_Alarm_History(0)
    Report_Daily_Arr_Alarm_History(0) = "None Alarm Occur By:" & str_Date
Else
    ReDim Report_Daily_Arr_Alarm_History(Report_Daily_Alarm_Count - 1, 9)
    DB_Rs.MoveFirst
    ReDim Arr_Data(9)
    For i = 0 To Report_Daily_Alarm_Count - 1

        For j = 0 To 9
            Arr_Data(j) = DB_Rs.Fields(Arr_Field(j)).Value
        Next
        
        If i <> Report_Daily_Alarm_Count - 1 Then
        DB_Rs.MoveNext
        DoEvents
        End If
        
        For j = 0 To 9 'Shift,result,Tool_Name.Module_Name,Alarm_Name,Action,Operator,Case_ID,Comment_Current,Comment_History
            If IsNull(Arr_Data(j)) = True Then
                Report_Daily_Arr_Alarm_History(i, j) = ""
            Else
                Report_Daily_Arr_Alarm_History(i, j) = Arr_Data(j)
            End If
            

            If j = 3 Then   'Modules
                str_Data = Arr_Data(3)
                ReDim Report_Daily_Arr_Alarm_Modules((Len(str_Data) / 6) - 1)
                'MsgBox (Len(DB_Rs.Fields(Arr_Field(3)).Value) / 6)
                For l = 0 To (Len(str_Data) / 6) - 1
                    
                    Report_Daily_Arr_Alarm_Modules(l) = Mid(str_Data, 1 + 6 * l, 5)
                    str_T = "Select ItemName from Info_ID_Tool_Module where Module_ID='" & Report_Daily_Arr_Alarm_Modules(l) & "'"   'Alarm_Modules 搜索语句
                    str_Modules = str_Modules & Pub_Load_Data_1(str_T, "Record_Info", DataBase_Type) & ","
                    
                    Report_Daily_Arr_Alarm_History(i, 3) = str_Modules
                Next
            End If
            
            If j = 4 Then   'Alarm
                str_Data = Arr_Data(4)
                ReDim Report_Daily_Arr_Alarm_IDs((Len(str_Data) / 7) - 1)
                For l = 0 To (Len(str_Data) / 7) - 1
                    Report_Daily_Arr_Alarm_IDs(l) = Mid(str_Data, 1 + 7 * l, 6)
                    str_T = "Select ItemName from Info_ID_Tool_Alarm where ItemID='" & Report_Daily_Arr_Alarm_IDs(l) & "'"   'Alarm_ID 搜索语句
                    str_Alarm = str_Alarm & "[" & l + 1 & ":" & Pub_Load_Data_1(str_T, "Record_Info", DataBase_Type) & "],"
                    
                    Report_Daily_Arr_Alarm_History(i, 4) = str_Alarm
                Next
            End If  
        Next
    Next
End If

End Function



共2个数据的话,当i=1时候
出现 "3265"错误代码:  
-> Arr_Data(j) = DB_Rs.Fields(Arr_Field(j)).Value

        For j = 0 To 9
            Arr_Data(j) = DB_Rs.Fields(Arr_Field(j)).Value
        Next
搜索更多相关主题的帖子: color 
2013-09-21 11:38
QQ342151559
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-10-10
收藏
得分:0 
str_Modules = str_Modules & Pub_Load_Data_1(str_T, "Record_Info", DataBase_Type) & ","

str_Alarm = str_Alarm & "[" & l + 1 & ":" & Pub_Load_Data_1(str_T, "Record_Info", DataBase_Type) & "],"

原来是这个导致出错了。。。。。解了
2013-09-21 12:11
快速回复:当多数据时,为何出现3265错误呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040115 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved