首頁 >資料庫 >mysql教程 >asp中怎么正确连接两条mysql 的sql语句啊?

asp中怎么正确连接两条mysql 的sql语句啊?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-06 09:34:251423瀏覽

mysqlasp

数据库mysql

dim sqlstr,rs,sqlstr1

set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="update mac set mac_del=-1 where mac_id='" & id & "';"
sqlstr=sqlstr & "insert into MACedited select *,now(),'隐藏设备' from MAC where mac_id='" & id & "';"
response.write sqlstr

rs.open sqlstr,conn,1,3
response.Redirect(request.ServerVariables("HTTP_REFERER"))

%>

sqlstr输出
update mac set mac_del=-1 where mac_id='40877';insert into MACedited select *,now(),'隐藏设备' from MAC where mac_id='40877';

报错

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

ODBC 驱动程序不支持所需的属性。
修改代码后
dim sqlstr,rs,sqlstr1

set rs=Server.CreateObject("ADODB.Recordset")

sqlstr="update mac set mac_del=-1 where mac_id='" & id & "';"
sqlstr1="insert into MACedited select *,now(),'隐藏设备' from MAC where mac_id='" & id & "';"
'sqlstr=sqlstr & "insert into MACedited select *,now(),'隐藏设备' from MAC where mac_id='" & id & "';"
response.write sqlstr

rs.open sqlstr,conn,1,3
rs.open sqlstr1,conn,1,3
response.Redirect(request.ServerVariables("HTTP_REFERER"))
%>
操作成功。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn