代码就是Kesion系统原有代码,红色字体那行报错
Dim FolderSql, Param
Param = " Where LabelType=" & LabelType
If KeyWord <> "" Then
FolderSql = "SELECT ID,FolderName,Description,OrderID,OrderID FROM [KS_LabelFolder] where 1=0"
Select Case SearchType
Case 0
Param = Param & " AND LabelName like '%" & KeyWord & "%'"
Case 1
Param = Param & " AND Description like '%" & KeyWord & "%'"
Case 2
Param = Param & " AND LabelContent like '%" & KeyWord & "%'"
End Select
If StartDate <> "" And EndDate <> "" Then
If CInt(DataBaseType) = 1 Then 'Sql
Param = Param & " And (AddDate>= '" & StartDate & "' And AddDate<= '" & DateAdd("d", 1, EndDate) & "')"
Else 'Access
Param = Param & " And (AddDate>=#" & StartDate & "# And AddDate<=#" & DateAdd("d", 1, EndDate) & "#)"
End If
End If
Else
FolderSql = "SELECT ID,FolderName,Description,OrderID as LabelFlag,OrderID FROM [KS_LabelFolder] where FolderType=" & LabelType & " And ParentID='" & FolderID & "'"
Param = Param & " AND FolderID='" & FolderID & "'"
End If
Param = Param & " ORDER BY OrderID "
Set LabelRS = Server.CreateObject("ADODB.recordset")
LabelRS.Open FolderSql & " UNION all Select ID,LabelName,Description,LabelFlag,OrderID from [KS_Label] " & Param, Conn, 1, 1