请问应该怎么写,用asp
[QUOTE]''=======查询条件参数========
Dim Condition,FormObj
Condition = " 1=1"
Dim KeyWord,BeginDate,EndDate,IncludeClass,AdminCode,ArtileStatus,TopFlag,VouchFlag,ArticlePic,Special
KeyWord = Request.Form("KeyWord")
BeginDate = Request.Form("BeginDate")
EndDate = Request.Form("EndDate")
IncludeClass = Request.Form("IncludeClass")
AdminCode = Request.Form("AdminCode")
ArtileStatus = Request.Form("ArtileStatus")
TopFlag = Request.Form("TopFlag")
VouchFlag = Request.Form("VouchFlag")
ArticlePic = Request.Form("ArticlePic")
Special = Request.Form("Special")
''判断传递来的参数值是否为空构造SQL查询条件
If KeyWord <> "" Then
Condition = Condition & " And Title like '%"& KeyWord &"%'"
End If
If BeginDate <> "" And IsDate(BeginDate) Then
Condition = Condition & " And PublitTime>='"& BeginDate &" 00:00:00'"
End If
If EndDate <> "" And IsDate(EndDate) Then
Condition = Condition & " And PublitTime<='"& EndDate &" 23:59:59'"
End If
If TopFlag = 1 Then
Condition = Condition & " And TopFlag='1'"
End If
If VouchFlag = 1 Then
Condition = Condition & " And VouchFlag='1'"
End If
If ArticlePic = 1 Then
Condition = Condition & " And ArticlePic<>''"
End If
If Special <> "" Then
Condition = Condition & " And ArticleSubject In("& Special &")"
End If
''===========================
''=========分页参数==========
Dim Page,TurnPageName,LinkStr
Page = Request.QueryString("Page")
TurnPageName = "PageName.Asp" '当前页面名称
LinkStr = ""
If Page = "" Or Not IsNumeric(Page) Then
Page = 1
Session("Condition") = Condition ''将查询条存储在SESSION中
Else
Condition = Session("Condition") ''在SESSION中提取查询条件
End If
''===========================
'构造出完整的SQL语句
SqlStr ="Select * From Article Where"& Condition &" Order By PublisTime Desc"[/QUOTE]