超难问题,不是高手请靠边走
从网页提交数据,和网站的ACCESS数据库里的一个字段比较,比较的结果用返回浏览器
* 提交的数据是字符串
* 返回浏览器的结果是个提示,比如“OK”、“NO OK”
问题点数:100、回复次数:12Top
1 楼znjgress(四空和尚)回复于 2006-03-02 20:41:21 得分 0
不是高手Top
2 楼patchclass(黑翼)回复于 2006-03-02 20:48:38 得分 1
放分吗?Top
3 楼kunlunlang(啊庸)回复于 2006-03-02 20:50:35 得分 0
哥们,偶真的不懂啊,偶刚学ASPTop
4 楼iuhxq(小灰)回复于 2006-03-02 20:52:17 得分 0
这是超级难题啊?看怎么实现了?Top
5 楼kunlunlang(啊庸)回复于 2006-03-02 20:56:04 得分 0
是啊,呵呵,对我来说,就是超难Top
6 楼winlmh(Sadly Lee)回复于 2006-03-02 21:17:02 得分 0
暈Top
7 楼kunlunlang(啊庸)回复于 2006-03-02 21:21:41 得分 0
我扶Top
8 楼mrwang2000(王先生)回复于 2006-03-02 21:30:48 得分 99
[个人意见,仅供参考]
做两个文件吧。
//-------------interface.asp---------------------
<form name="form1" method="post" action="CompareAndShow.asp">
<input type="text" name="txtMyInfo">
<input type="submit" name="Submit" value="提交">
</form>
//--------------CompareAndShow.asp---------------
<%
dim MyInfo : MyInfo = trim(request.Form("txtMyInfo"))
dim conn,rs,errmsg,strConn,DBPath,IsOK
DBPath = "YourDatabase.mdb"
strConn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & Server.MapPath(trim(DBPath))
set conn = Server.CreateObject("ADODB.Connection")
conn.open strconn
IsOK = "NO OK"
set rs = Server.CreateObject("ADODB.Recordset")
if not conn is nothing then
rs.open "SELECT * FROM yourTable WHERE yourField = '"+MyInfo+"'",conn,3,3
else
rs.close
set rs = nothing
end if
if not rs is nothing then
if not (rs.bof and rs.eof) then
IsOK = "OK"
end if
end if
response.Write(IsOK)
%>Top
9 楼mrwang2000(王先生)回复于 2006-03-02 21:33:08 得分 0
response.Write(IsOK)
的后面再加上
if not rs is nothing then rs.close
set rs= nothing
if not conn is nothing then conn.close
set conn = nothingTop
10 楼mrwang2000(王先生)回复于 2006-03-02 21:34:40 得分 0
接分!!!!!!Top
11 楼lovebeyondforever(我不信)回复于 2006-03-02 23:49:15 得分 0
可疑!Top
12 楼kunlunlang(啊庸)回复于 2006-03-03 00:22:41 得分 0
准备给分Top




