2016-04-26 26 views
-1

asp - > odbc - > mysql,多查詢問題。在asp經典中如何執行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 [email protected];");:錯誤

ERR消息:

[MySQL的] [ODBC 5.2(w)的驅動程序]的[mysqld-5.1.45p1日誌]你有你的SQL語法錯誤;檢查對應於你的MySQL服務器版本使用附近的「更新wp_posts正確的語法手冊........

我該如何解決這個問題? SOS !!!

不喜歡的答案:

dbCon.execute("set @aa=1602;"); 
dbCon.execute("update wp_posts set post_abc = '1234' where [email protected];"); 

回答

5

前往

詳情添加MULTI_STATEMENTS=1在連接字符串,或啓用在DSN項多個查詢 - >連接 - >允許多個語句

+0

MULTI_STATEMENTS = 1:好!好!好!好!好!好!好!謝謝你!謝謝你!謝謝你!謝謝你!謝謝你!謝謝你!謝謝你!感謝-U!^^ –