尋找正確的語法,如何獲取該做的所有記錄「NOT EXISTS」在主數據庫,但在遠程DB獲取記錄NOT IN本地數據庫,但在遠程數據庫
做到以下代碼獲取所有空白記錄從遠程數據庫不確定它是否與本地數據庫相關。
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="<%$ ConnectionStrings:accessConnectionString %>"
SelectCommand="SELECT EnrollmentsTbl.UserName, EnrollmentsTbl.SubmitTime, EnrollmentsTbl.ClassName,
EnrollmentsTbl.ClassDate, EnrollmentsTbl.ClassTime, EnrollmentsTbl.Enrolled, EnrollmentsTbl.WaitListed, EnrollmentsTbl.Instructor,
EnrollmentsTbl.DateCompleted, EnrollmentsTbl.Completed, EnrollmentsTbl.Walkin
FROM [;DATABASE=e:\subsite.mdb].EnrollmentsTbl AS XXX
LEFT JOIN EnrollmentsTbl ON XXX.UserName = EnrollmentsTbl.UserName WHERE (EnrollmentsTbl.UserName Is Null)">
</asp:AccessDataSource>
[在運算符中沒有()在查詢表達式中]的可能重複(http://stackoverflow.com/questions/22698305/in-operator-wi在查詢中使用表達式) – Brad
示例代碼不會失敗?它只是返回不正確的記錄 – BarclayVision