【发布时间】:2017-07-06 14:19:00
【问题描述】:
您好,我正在尝试让 SQL 从用户从列表框中选择的表中进行选择
这是我的代码
activity := cmbActivity.Text; //this is where the user selects a table to choose from
qryStudents.SQL.Text := 'SELECT * FROM :activity WHERE CompNo = :iCompNo'; //error here
qryStudents.Parameters.ParamByName('activity').Value:= activity;
qryStudents.Parameters.ParamByName('iCompNo').Value := iCompNo;
qryStudents.Open;
我在 SQL 代码 (:activity) 中的 FROM 之后不断收到语法错误 任何帮助将不胜感激
【问题讨论】: