數據庫教程連接程序
sub opensql()
set sqlrs=server
set sqlcn=server
sqlconstr="driver={sql server};server=xiewen;uid=sa;pwd=
sqlcn
end sub
//功能處理程序asp教程把內容保存到數據庫
<%dim f_id
f_id=request
tag=request
lytxt=html_encode(request
names=session("lyname")
if names="" then
names="匿名"
end if
if (not isnumeric(f_id)) or (not isnumeric(tag)) or len(lytxt)<
response
else
sql="select * from guestbook"
on error resume next
call opensql()
sqlrs
sqlrs
sqlrs("ly")=lytxt
sqlrs("f_id")=f_id
sqlrs("tag")=tag
sqlrs("name")=names
sqlrs
if err=
response
else
response
end if
end if
%>
html提供頁面
<input name=lytxt >
<input type=submit value提交 />
From:http://tw.wingwit.com/Article/program/net/201311/14112.html