%
Dim ConnString,rs,n,conn
office_administer="test1"
ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("data\ncaidsvip.mdb")
'###########################################################################################
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open ConnString
Sub NiceError(text)
conn.close
set conn=nothing
Response.Write "
" & text
Response.End
End Sub
sub openrs(rs, sql,i,j)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn,i,j
end sub
function ChkString(strValue,strType)
if IsNull(strValue) or trim(strValue)="" then
ChkString = " "
else
if strType="unhtml" then
strValue=RTrim(strValue)
strValue=replace(strValue,"''","'")
strValue=replace(strValue," "," ")
strValue=replace(strValue,"<","<")
strValue=replace(strValue,vbCrLf,"
")
ChkString = strValue
exit function
end if
if strType="replymail" then
strValue=RTrim(strValue)
strValue=replace(strValue," "," ")
strValue=replace(strValue,vbCrLf,"
")
ChkString = strValue
exit function
end if
if strType="unhtml1" then
strValue=RTrim(strValue)
strValue=replace(strValue,"''","'")
strValue=replace(strValue," "," ")
strValue=replace(strValue,"<","<")
strValue=replace(strValue,vbCrLf,"
")
strValue=replace(strValue,"|"," ")
ChkString = strValue
exit function
end if
if strType="save" then
strValue=RTrim(strValue)
strValue=replace(strValue,"'","''")
ChkString = strValue
exit function
end if
if strType="unreplace" then
strValue=RTrim(strValue)
strValue=replace(strValue,"''","'")
ChkString = strValue
exit function
end if
if strType="save1" then
strValue=RTrim(strValue)
strValue=replace(strValue,"'","''")
strValue=replace(strValue," ","|")
ChkString = strValue
exit function
end if
end if
end function
function ToURL(strValue)
if IsNull(strValue) then strValue = ""
ToURL = Server.URLEncode(strValue)
end function
function DateToStr(dtDateTime)
DateToStr = year(dtDateTime) & doublenum(Month(dtdateTime)) & doublenum(Day(dtdateTime)) & doublenum(Hour(dtdateTime)) & doublenum(Minute(dtdateTime)) & doublenum(Second(dtdateTime)) & ""
end function
function doublenum(fNum)
if fNum > 9 then
doublenum = fNum
else
doublenum = "0"& fNum
end if
end function
function htmlencode2(str)
dim result
dim l
if isNULL(str) then
htmlencode2=""
exit function
end if
l=len(str)
result=""
dim i
for i = 1 to l
select case mid(str,i,1)
case "<"
result=result+"<"
case ">"
result=result+">"
case chr(13)
result=result+"
"
case chr(34)
result=result+"""
case "&"
result=result+"&"
case chr(32)
'result=result+" "
if i+1<=l and i-1>0 then
if mid(str,i+1,1)=chr(32) or mid(str,i+1,1)=chr(9) or mid(str,i-1,1)=chr(32) or mid(str,i-1,1)=chr(9) then
result=result+" "
else
result=result+" "
end if
else
result=result+" "
end if
case chr(9)
result=result+" "
case else
result=result+mid(str,i,1)
end select
next
htmlencode2=result
end function
%>