两个DBGrid之间的问题, 先谢,问题明确下,就是当我双击DBGrid1中的一列数据后,在DBGrid2中会显示出这列数据,如何实现?DBGrid1.DbClick事件要怎么写, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dbgrid1 帮定的dataset1dbgrid2 帮定的dataset2dbgrid1 onclick事件dataset2.close;dataset2.commandtext:='selct * from tables where xx='+quotedstr(dataset1.fieldbyname('xx').asstring);dataset2.open; DbGrid1接DataSet1DataSet1中的SQL语句为Select * from Tablewhere 1=1DbGrid接DataSet2DataSet2中的SQL语句为Select * from tablewhere 1=0然后DbGrid1中双击的时候Begin DataSet1.FieldByName('主键或唯一标志').value; 然后 DataSet2.Close; DataSet2.Sql[1] := 'where 主键或唯一标记 = '上面的DataSet1.FieldByName('主键或唯一标志').value; DataSet2.Open;end; 其实楼上两位的方法都差不多的 关键是这一句: DataSet2.Sql[1] := 'where 主键或唯一标记 = '上面的DataSet1.FieldByName('主键或唯一标志').value; dbgrid1 onclick事件dataset2.close;dataset2.commandtext:='selct * from tables where xx='+quotedstr(dataset1.fieldbyname('xx').asstring);dataset2.open; 有没有杭州萧山要新人的,如果没有有没有一起学习的 将一个字段分为两个字段显示,Select into 的问题 100分送给真正的朋友! 我想把rtf格式的文档保存到数据库里,然后生成html显示,行吗 日期问题. 请推荐好的delphi入门书籍 为什么我的程序一按运行就连整个DELPHI 都关闭掉了?帮我找出问题,马上给200分!高手帮忙呀! 如果能更有效地对字符串加密? 拼音的问题 不好意思,有没有哪位仁兄告诉我应该怎样把数据库中的某个数据显示在一个treeview中呢? DXdbgrid的问题! 两个mdichild窗体之间的协作问题?
dbgrid2 帮定的dataset2dbgrid1 onclick事件
dataset2.close;
dataset2.commandtext:='selct * from tables where xx='+quotedstr(dataset1.fieldbyname('xx').asstring);
dataset2.open;
DataSet1中的SQL语句为
Select * from Table
where 1=1DbGrid接DataSet2
DataSet2中的SQL语句为
Select * from table
where 1=0然后
DbGrid1中双击的时候
Begin
DataSet1.FieldByName('主键或唯一标志').value;
然后
DataSet2.Close;
DataSet2.Sql[1] := 'where 主键或唯一标记 = '上面的DataSet1.FieldByName('主键或唯一标志').value;
DataSet2.Open;
end;
其实楼上两位的方法都差不多的 关键是这一句: DataSet2.Sql[1] := 'where 主键或唯一标记 = '上面的DataSet1.FieldByName('主键或唯一标志').value;
dataset2.close;
dataset2.commandtext:='selct * from tables where xx='+quotedstr(dataset1.fieldbyname('xx').asstring);
dataset2.open;