你不select成一个query再来好一点
解决方案 »
- WebBrowser的问题,自动提交数据
- mxOutLookBarPro 控件使用问题
- Listview中通过自画方式能够嵌入panel或ComboBox之类的组件吗?
- 感觉DELPHI的BUG很多呀,大家来讨论一下,来者有分
- 高分求助:delphi中关于access数据表的导入和导出问题
- 类
- 可不可以把反含有自己添加的计算字段的TTable中的显示出来的数据写回另一个DB文件中??
- 怎样才能把Edit.text 里面的字体偏右排列?
- 我是学vc的,现在开始学delphi了,希望大家多多关照!先散点分!
- 急问如何打印dbgrid控件里的数据和form上的内容?
- 回答问题给分!!!!!
- 请问我要用进度条显示这个PcmtoWave(Pchar(FileName.Text),Pchar(FileName.text+'.wav'))函数执行的进度,应该怎样编程?
procedure TForm1.QRDBText1Print(sender: TObject; var Value: String);
begin
// 处理 value就可以了,如:
query1.close;
query1.sql.clear;
query1.sql.add('select aaa from at where name='+''''+value+'''');
value :=query1.fieldbyname('aaa').asstring;
query1.close;
end;
第一个QuickRep的datasource连接一个Query1;
控件连接好,生成报表直接预览就可以了。
对于第二个QuickRep连接Query2
预览时,要进行查询,后预览。
首先,取到表1中的代码,如:
edit1.text:='代码';
procedure Button1Click(Sender: TObject);
begin
with Query2 do
begin
close;
with sql do
begin
clear;
add(select * from table2);
add('where id=:a');
Params[0].AsString:=Edit1.Text;
Open;
end;
end;
end;
这只是针对于一个代码来说的,如果对于各个代码都要这样做的话,你就要使用数组和循环,自己研究一下。
例如查找table1中的id1为table2 中的id2 的值。sqltext:=select * from (select * from table1) a,(select * from table1)b where a.id1=b.id2