这是我的代码:

command.CommandText =
   "SELECT DISTINCT B.* FROM BlankFormSubmissions B, Actions A WHERE B.FormName = " +
   GenericRoutines.SqlFmt(form.Name) +
   " AND B.ProcessName = A.ProcessName AND B.ActionName = A.ActionName" +
   " ORDER BY B.ID";

OleDbDataReader reader = command.ExecuteReader();


SQL是:

SELECT DISTINCT B.*
FROM BlankFormSubmissions B, Actions A
WHERE B.FormName = 'FindingNemo'
  AND B.ProcessName = A.ProcessName
  AND B.ActionName = A.ActionName
ORDER BY B.ID

最佳答案

通过在Access中运行SQL,我发现我实际上只是在引用Access表中不存在的列(FormName)。

10-01 12:48