<form name="form1" action="js4.asp" method="post">
<input name="psw1" type="text" /><br>
<input name="submit" type="submit" id="submit" value="提交" />
</form>
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<%
use=Request.Form("psw1")
var conn = Server.CreateObject("ADODB.Connection");
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("learn.mdb");
conn.Open;
var rs= conn.Execute("select * from [guestbook] where (这里怎么写)");
while (!rs.eof){
Response.write("编号:"+rs("id").Value+"<br/>");
rs.MoveNext()
}
rs.Close();
conn.Close();
%>
(这里怎么写)这里偶是写 where name like aa(aa为数据库中资料)正确写出~~
where name like ('&use&')没反映-什么都没~-_-#
where name like ('"&use&'")500.100错误~~
比如模糊查询怎么写('*a*')吗
我用的是ACCCESS数据库
偶也想知道SQL2000怎么写!
不知道为什么怎么看VB怎么别扭~~
想用JAVASCRIPT写~~~

解决方案 »

  1.   

    javascript是IE浏览器支持的,所以必须得通过odbc来连接数据库。建议你看看ActiveObject()
      
    建议你看下
    http://www.cqwi.com/design/zpxs/sjk/200604/3330.htm
    这个功能没什么意义 主要是服务器权限问题
      

  2.   

    where name like '%"&你要查询的变量&"%' 
      

  3.   

    试了2位前辈的做法 模糊查询已经解决~~
    但是~~我觉得我的问题现在应该是 
    我没有提交表单 就已经执行了~~查询语句了~~~
    是不是错在这里?
    use=Request.Form("psw1")