![](/img/trans.png)
[英]SQL VBA Run-Time Error 3075: Syntax error(missing operator) in query expression
[英]Run time error 3075 - missing operator
我在以下SQL查詢上有一個運行時錯誤3075。 我試圖在MS Access 2010中執行。錯誤消息告訴我在連接查詢上有語法錯誤(缺少運算符)。 我找不到它。
Private Sub comando21_dblclick(cancel As Integer)
Dim st_sql As String
st_sql = "INSERT INTO tblsearchengine01 (
[id event],
[id project],
[id_project_phase],
[owner],
[contact],
[event],
[type],
[participant],
[role_type],
[commitment],
[description],
[identification_status],
[overall_status],
[status],
[tblmasterlistofeventsnotes],
[tblmasterlistofeventshistorynotes],
[automatic user entry],
[automatic date of entry],
[automatic_user_entry],
[automatic_date_of_entry],
[expected start date],
[actual start date],
[expected completion date],
[actual completion date],
[effective date],
[priority]
) SELECT
[tblmasterlistofevents].
[id event],
[tblmasterlistofevents].[id project],
[tblmasterlistofevents].[id_project_phase],
[tblmasterlistofevents].[owner],
[tblmasterlistofeventshistory].[contact],
[tblmasterlistofevents].[event],
[tblmasterlistofeventshistory].[type],
[tblprojmanagementphaseparticipants].[participant],
[tblprojmanagementphaseparticipants].[role_type],
[tblmasterlistofevents].[commitment],
[tblmasterlistofeventshistory].[description],
[tblmasterlistofevents].[identification_status],
[tblmasterlistofevents].[overall_status],
[tblmasterlistofeventshistory].[status],
[tblmasterlistofevents].[notes],
[tblmasterlistofeventshistory].[notes],
[tblmasterlistofevents].[automatic user entry],
[tblmasterlistofevents].[automatic date of entry],
[tblmasterlistofeventshistory].[automatic_user_entry],
[tblmasterlistofeventshistory].[automatic_date_of_entry],
[tblmasterlistofevents].[expected start date],
[tblmasterlistofevents].[actual start date],
[tblmasterlistofevents].[expected completion date],
[tblmasterlistofevents].[actual completion date],
[tblmasterlistofeventshistory].[effective date],
[tblmasterlistofevents].[Priority]
FROM [tblmasterlistofevents]
INNER JOIN [tblprojmanagementphaseparticipants]
ON [tblmasterlistofevents].[id event]=[tblprojmanagementphaseparticipants].[ID_Event]
INNER JOIN [tblmasterlistofeventshistory]
ON [tblmasterlistofevents].[id event]=[tblmasterlistofeventshistory].[ID_Event]"
Application.DoCmd.RunSQL (st_sql)
End Sub
這是你的from
子句:
FROM [tblmasterlistofevents] INNER JOIN
[tblprojmanagementphaseparticipants]
ON [tblmasterlistofevents].[id event] = [tblprojmanagementphaseparticipants].[ID_Event] INNER JOIN
[tblmasterlistofeventshistory]
ON [tblmasterlistofevents].[id event]= [tblmasterlistofeventshistory].[ID_Event]
當您執行多個連接時,Access需要括號。 嘗試這個:
FROM ([tblmasterlistofevents] INNER JOIN
[tblprojmanagementphaseparticipants]
ON [tblmasterlistofevents].[id event] = [tblprojmanagementphaseparticipants].[ID_Event]
) INNER JOIN
[tblmasterlistofeventshistory]
ON [tblmasterlistofevents].[id event]= [tblmasterlistofeventshistory].[ID_Event]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.