W
wdsu
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tfm_mainxt.TreeView1Change(Sender: TObject; Node: TTreeNode);
Var
v_customerid:integer;
v_custname,v_year,v_month,v_day:string;
begin
if TreeView1.Selected=nil then
exit;
Node.Selected:=true;
with qry_customer do
begin
close;
sql.Add('select * from customer where customer_name=:kehu');
parambyname('kehu').AsString:=treeview1.Selected.text;
prepare;
open;
end;
with datamodule2.qryorders do
begin
close;
sql.Add('select * from orders where customerid=:kehuid');
parambyname('kehuid').AsString:=qry_orders1.fieldbyname('customerid').AsString;
prepare;
open;
end;
我的数据表如下:
客户表:
customer: int char char char
customerid customername customeraddr customertel
客户编号 客户姓名 客户地址 客户电话
定单表:
orders: int int date int
ordersno customerid orderdate ordersnum
定单编号 客户编号 定货日期 定单总数量
详细记录表:
ordersdetail int int int int
ordersno itemsno partsno numbers
定单编号 子项目序号 产品代号 数量
end;
然后我在ds_orders,ds_ordersdetail(datasource)的DATACHANGE写了主从关系的代码,运行时
出现---------------------------
Debugger Exception Notification
---------------------------
Project p_orders_design.exe raised exception class EDBEngineError with message 'Query returned multiple result sets.'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
--------------------------
请教?有更好的办法吗
Var
v_customerid:integer;
v_custname,v_year,v_month,v_day:string;
begin
if TreeView1.Selected=nil then
exit;
Node.Selected:=true;
with qry_customer do
begin
close;
sql.Add('select * from customer where customer_name=:kehu');
parambyname('kehu').AsString:=treeview1.Selected.text;
prepare;
open;
end;
with datamodule2.qryorders do
begin
close;
sql.Add('select * from orders where customerid=:kehuid');
parambyname('kehuid').AsString:=qry_orders1.fieldbyname('customerid').AsString;
prepare;
open;
end;
我的数据表如下:
客户表:
customer: int char char char
customerid customername customeraddr customertel
客户编号 客户姓名 客户地址 客户电话
定单表:
orders: int int date int
ordersno customerid orderdate ordersnum
定单编号 客户编号 定货日期 定单总数量
详细记录表:
ordersdetail int int int int
ordersno itemsno partsno numbers
定单编号 子项目序号 产品代号 数量
end;
然后我在ds_orders,ds_ordersdetail(datasource)的DATACHANGE写了主从关系的代码,运行时
出现---------------------------
Debugger Exception Notification
---------------------------
Project p_orders_design.exe raised exception class EDBEngineError with message 'Query returned multiple result sets.'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
--------------------------
请教?有更好的办法吗