Rewiah(乘长风) 的方法不行! 只有一个可能,你的bbbsid不是数字,你这么判断一下: if not (bbbsid is nothing ) then if isnumeric(bbbsid) then strSQL = "Select * from mains where id=" & bbbsid else '出错处理 endif else '出错处理 endif
试一试: "SELECT * FROM [mains] WHERE id LIKE '" & bbbsid & "'"
bbbsid=Request.QueryString("bbsid")set mc= Server.CreateObject("ADODB.Connection")
mc.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("bbsdb.mdb")
set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "Select * from mains where id='" & bbbsid & "' "
rs.open strsql,mc 错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
/lhd/one.asp, 第 28 行第 28 行为:
rs.open strsql,mc
当把第27行换成:
strSQL = "Select * from mains where c_id='" & bbbsid & "' "
可行!
改成 strSQL = "Select * from mains where id=" & bbbsid
应该就对了!
Rewiah(乘长风) 的方法不行!
感谢!
只有一个可能,你的bbbsid不是数字,你这么判断一下:
if not (bbbsid is nothing ) then
if isnumeric(bbbsid) then
strSQL = "Select * from mains where id=" & bbbsid
else
'出错处理
endif
else
'出错处理
endif
"SELECT * FROM [mains] WHERE id LIKE '" & bbbsid & "'"