conn.execute N条SQL语句的问题
的有关信息介绍如下:把你贴出来的这段代码换成下面的这句试试:
conn.execute("insert into ppst_Msg (Geter,Sender,Title,Content,SendTime,HasRead) Select top 30 ID,"&Sender_ID&",'"&Title&"','"&Content&"','"&Now()&"',0 from [PPst_User] where City='"&City&"' and Usersex=1")
看能不能得到你想要的效果。
首先你循环,拼接所有要执行的sql,然后再执行conn.execute(sql)
可以使用StringBuilder进行拼接,效率更高.中间可以用;格开