adoquery1.close;
adoquery1.Connection:=ADOConnection1;
id:=adoquery1.SQL.Add('select section_id from section where section_name='+''+formnewreport.ComboBox3.Text+'')执行报错:列名'学习部'无效....但是数据库里是有section_id =1,section_name=学习部这行记录的....是不是我在combobox3取数据时有问题呢?
adoquery1.Connection:=ADOConnection1;
id:=adoquery1.SQL.Add('select section_id from section where section_name='+''+formnewreport.ComboBox3.Text+'')执行报错:列名'学习部'无效....但是数据库里是有section_id =1,section_name=学习部这行记录的....是不是我在combobox3取数据时有问题呢?
adoquery1.close;
adoquery1.Connection:=ADOConnection1;
adoquery1.SQL.Add('select section_id from section where section_name='+ Quotedstr(formnewreport.ComboBox3.Text))
adoquery1.open;
if not adoquery1.isEmpty then ID := adoquery1.fieldbyname('section_ID').value;