How can I correctly connect two mysql SQL statements in asp?

Source: Internet
Author: User
Database mysqlsqlstr output updatemacsetmac_del-1wheremac_id & #39; 40877 & #39; insertintoMACeditedselect *, now (), & #39; hidden device & #39; fromMACwheremac_id & #39; 40877 & #39; error Microso mysqlasp

Mysql database
<%

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 (), 'hide device' from MAC where mac_id = '" & id &"';"
Response. write sqlstr

Rs. open sqlstr, conn, 1, 3
Response. Redirect (request. ServerVariables ("HTTP_REFERER "))

%>

Sqlstr output
Update mac set mac_del =-1 where mac_id = '20160301'; insert into MACedited select *, now (), 'hide device' from MAC where mac_id = '20160301 ';

Error

Microsoft ole db Provider for ODBC Drivers error '80040e21'

ODBC drivers do not support the required attributes.
After modifying the code
<%
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 (), 'hide device' from MAC where mac_id = '" & id &"';"
'Sqlstr = sqlstr & "insert into MACedited select *, now (), 'hide device' 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 "))
%>
Operation successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.