如何exectue MySQL多查询,在asp经典?

-1 mysql odbc asp-classic

asp - > odbc - > mysql,多查询问题.

dbCon.execute("update wp_posts set post_abc = '1234' where ID=1602';");: 没问题

dbCon.execute("set @aa=1602;update wp_posts set post_abc = '1234' where ID=@aa;");:错误

错误的消息:

[MySQL] [ODBC 5.2(w)驱动程序] [mysqld-5.1.45p1-log] SQL语法中有错误; 检查与您的MySQL服务器版本对应的手册,以便在'update wp_posts ........附近使用正确的语法.

我怎样才能解决这个问题?SOS !!!

不喜欢的答案:

dbCon.execute("set @aa=1602;");
dbCon.execute("update wp_posts set post_abc = '1234' where ID=@aa;");
Run Code Online (Sandbox Code Playgroud)

erg*_*erg 6

添加MULTI_STATEMENTS=1连接字符串,或者通过转到在DSN条目中启用多个查询

详细信息 - >连接 - >允许多个语句