cnDataConnection.Execute "Insert into NResultTable (Code, Motive, Opponent, Price, Amount, Ratio) Select Code, Motive, Opponent, Price, Amount, Ratio from NBidTable where Code='" & Trim(vstrBondCode) & "' order by Motive, Opponent, Price"
调试欢乐多
假如要从数据库abc中的kk表选取记录插入到数据库bcd的qq表,那么应该
INSERT INTO qq(zone1, zone2)
SELECT zone1, zone2
FROM abc..kk
WHERE (zone1= 5)
我現在要的是查詢
With adorecordset
.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;pwd=system;Initial Catalog=erp;Data Source=172.18.2.29"
.RecordSource = "select * from 員工 where 員工碼<>Uneec管理系統.員工工號"
.Refresh
End With
其中Uneec管理系統和ERP分別兩個數據庫
結果出了錯"資料行前置詞 'Uneec管理系統.員工' 與用於查詢中的資料表名稱或別名不符"
請問有何解救之法??
2。如果你想从另一个数据库中得到数据,不应如此:
改为:
select * from 員工 where 員工碼 not in (select 員工碼 from Uneec管理系統..員工)
没有表名,结构如下
数据库名.表名.列名