asp+access的问题,请高手帮忙!
我写了一段简单的通过网络查分的代码,在本地服务器上运行的好好的,上传到一个免费的空间以后不能正常工作了,显示这个
Microsoft OLE DB Provider for ODBC Drivers error '80040e21 '
ODBC driver does not support the requested properties.
/searchlook.asp, line 32
都快郁闷死了,后来发现不写查询条件,直接SELECT * FROM djks能显示出来,难道查询语句写的不对??不过在本地运行的挺好的啊,请高手帮帮忙,代码如下:
<%
dim key
dim biao
key=Request( "key ")
biao=Request( "biao ")
%>
<%
Select case biao
case "身份证号 "
biao= "sfzh "
case "准考证号 "
biao= "zkzh "
case "姓名 "
biao= "xm "
case " "
biao= "xb "
case " "
biao= "bscj "
case " "
biao= "sjcj "
case Else
Response.Redirect( "index.asp ")
End Select
%>
<%If key <> " " and biao <> " " Then%>
<%
set conn=server.createobject( "adodb.connection ")
DBPath = Server.MapPath( "djks.mdb ")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq= " & DBPath
Set rs = Server.CreateObject( "ADODB.Recordset ")
sql = "SELECT * FROM djks where "+biao+ " like '% "+key+ "% ' "
rs.Open sql, conn, 1, 1
%>
------解决方案--------------------看情况是没辙,人家服务器限制不支持数据库条件查询
------解决方案--------------------sql = "SELECT * FROM djks where "&biao& " like '% "&key& "% ' "
------解决方案--------------------sql = "SELECT * FROM djks where "+biao+ " like '% "+key+ "% ' "
你这个语句哪里能用? JS? ASP都是楼上那位的写法吧?
sql = "SELECT * FROM djks where "&biao& " like '% "&key& "% ' "