请问有多个表,想通过键入名字查询到记录,怎么做? 我这么做行吗? with adotable1,adotable2,.... do begin if locate('name',edit1.text,[]) then : : end; 另外 with adotable1 do begin : end; with adotable2 do begin : end; ......... 我发现这样做,只是对最后一个表查询了。
----------------------------------------------
-CRAZY FAN OF DELPHI
with DataModule1.Qy_termResult do //修改存储过程文件“Proc_term_result” begin close; sql.add('select result_info.student_ID as 学号,studentname_info.student_name as 姓名,studentname_info.retire 备注,'); sql.add('from result_info inner join studentname_info on '); sql.add('result_info.student_ID=studentname_info.student_ID where studentname_info.class=''+CB_Class.Text+'' and result_info.academic_year=''+CB_Academicyear.Text+'' and result_info.term=''+CB_term.Text+''); ExecSQL; //close; end;
----------------------------------------------
读好书可以净化心灵,交挚友能够升华人生。山外有山,能人背后自有更强能人在!
with DataModule1.Query do begin close; sql.add('select result_info.student_ID as 学号,studentname_info.student_name as 姓名,studentname_info.retire 备注,'); sql.add('from result_info inner join studentname_info on '); sql.add('result_info.student_ID=studentname_info.student_ID where studentname_info.class=''+CB_Class.Text+'' and result_info.academic_year=''+CB_Academicyear.Text+'' and result_info.term=''+CB_term.Text+''); ExecSQL; //close; end; 这些代码希望对你有用,上面带的说明“//修改存储过程文件“Proc_term_result”是多余了,不要被误解。