|
使用下面的语句,把数据追加到sql表中,出现有错误,但sql语句在access查询中却是正确的,请问是什么问题?谢谢
Dim rs As New ADODB.Recordset
Set cnn = New ADODB.Connection
cnn.Open "rovider=SQLOLEDB;Data Source=*.*.*.*;UID=saWD=******;initial catalog=SQL"
sql = "INSERT INTO Tb_表A_temp ( 表AID, 表BID, FZID, FHQTY1, FHDPT, FH ) SELECT 表AID, 表BID, FZID, Sum(FHQTY) AS FHQTY1,FHDPT,FH FROM Tb_表A WHERE 表AID&表BID&FZID&FHQTY In(select 表AID&表BID&FZID&FHQTY as UnF from Tb_表A group by 表AID&表BID&FZID&FHQTY having count(*)=1) GROUP BY 表AID, 表BID, FZID, FHQTY,FHDPT,FH"
rs.Open sql, cnn, adOpenStatic, adLockOptimistic
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|