<!--#include file="conn.asp"-->
<%
xh=request.form("xh")
xm=request.form("xm")
cym=request.form("cym")
bj=request.form("bj")
xb=request.form("xb")
mz=request.form("mz")
jg=request.form("jg")
zzmm=request.form("zzmm")
csny=request.form("csny")
sxzy=request.form("sxzy")
xz=request.form("xz")
xl=request.form("xl")
pymb=request.form("pymb")
syd=request.form("syd")
yhtc=request.form("yhtc")
sf=request.form("sf")
sf=request.form("sf")
dianhua=request.form("dianhua")
dzyx=request.form("dzyx")
bz=request.form("bz")
conn.exec="INSERT
INTO stuinfo
VALUES
("+xh+",'"+xm+"','"+cym+"','"+bj+"','"+xb+"','"+mz+"','"+jg+"','"+zzmm+"','"+csny+"','"+sxzy+"','"+xz+"','"+xl+"','"+pymb+"'
'"+syd+"','"+yhtc+"','"+sf+"','"+dianhua+"','"+dzyx+"','"+bz+"')
conn.execute exec
conn.close
set conn=nothing
response.redirect "welcome.asp"
%>
这个是conn.asp
<%
dim asconn
set asconn=server.createobject("adodb.connection")
asconn.open = "provider=SQLOLEDB.1;data source=XZLIXUN;"&_
"initial catalog=DB;user id=sa;password=sa;"
function encodestr(str)
str=trim(str)
str=replace(str,"<","<")
str=replace(str,">",">")
str=replace(str,"""","'")
str=replace(str,vbCrLf&vbCrlf,"</p><p>")
str=replace(str,vbCrLf,"<br>")
encodestr=replace(str," ","")
end function
function cutstr(tempstr,tempwid)
if len(tempstr)>tempwid then
cutstr=left(tempstr,tempwid)&"..."
else
cutstr=tempstr
end if
end function '限制新闻标题的显示字数的函数,后面以...显示
function astext(vstrin) '字符编码
dim i,strreturn
strreturn = ""
for i = 1 to len(vstrin)
thischr = mid(vstrin,i,1)
if abs(asc(thischr)) < &hff then
strreturn = strreturn & thischr
else
innercode = asc(thischr)
if innercode < 0 then
innercode = innercode + &h10000
end if
hight8 = (innercode and &hff00)\ &hff
low8 = innercode and &hff
strreturn = strreturn & "%" & hex(hight8) & "%" & hex(low8)
end if
next
astext = strreturn
end function
%>