出现语法错误 (操作符丢失) 在查询表达式 'id=' 中。
xiugai.asp页面代码<%setconn=server.createobject("adodb.connection")conn.open"driver={micr...
xiugai.asp页面代码
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("/11/data/db2.mdb")
exec="select * from test where id="&request.querystring("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="xiugai1.asp">
<table width="748" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>
<input type="text" name="aa" value="<%=rs("aa")%>">
</td>
<td>
<input type="text" name="bb" value="<%=rs("bb")%>">
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="id" value="<%=request.querystring("id")%>">
</td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("/11/data/db2.mdb")
exec="select * from test where id="&request.querystring("id")
set rs=server.createobject("adodb.recordset")
rs.open exec,conn
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="xiugai1.asp">
<table width="748" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>
<input type="text" name="aa" value="<%=rs("aa")%>">
</td>
<td>
<input type="text" name="bb" value="<%=rs("bb")%>">
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="id" value="<%=request.querystring("id")%>">
</td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 展开
4个回答
展开全部
把SQL语句这样写,你试一下:
exec="select * from test where id="&request.querystring("id")&""
exec="select * from test where id="&request.querystring("id")&""
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个可以用Access自动生成SQL语句啊,新建查询向导,然后选择要查询的表和列就可以了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql="select
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'"&ParentID&"')>0
and
ParentID=0
order
by
ID
asc"
SQL里不能用双引号,如里需要,要转义
sql="select
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'&ParentID&')>0
and
ParentID=0
order
by
ID
asc"
或
sql="select
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'\"&ParentID&\"')>0
and
ParentID=0
order
by
ID
asc"
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'"&ParentID&"')>0
and
ParentID=0
order
by
ID
asc"
SQL里不能用双引号,如里需要,要转义
sql="select
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'&ParentID&')>0
and
ParentID=0
order
by
ID
asc"
或
sql="select
*
from
ComSiteCMS_OthersSort
where
ViewFlag
and
Instr(SortPath,'\"&ParentID&\"')>0
and
ParentID=0
order
by
ID
asc"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询