<% DB="yanhan/20%#20%hanbindata.mdb" Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&DB&"") conn.Open connstr Function FormatSQL(strChar) if strChar="" then FormatSQL="" else FormatSQL=replace(replace(replace(replace(replace(replace(replace(replace(strChar,"'","’"),"*","×"),"?","?"),"(","("),")",")"),"<","〈"),".","。"),";",";") end if End Function Function SafeRequest(ParaName,ParaType) Dim ParaValue ParaValue=FormatSQL(Request(ParaName)) If ParaType=1 then If not isNumeric(ParaValue) then Response.write "
参数" & ParaName & "必须为数字型!
" Response.end End if Else ParaValue=replace(ParaValue,"'","''") End if SafeRequest=ParaValue End function %>