当前位置:编程学习 > VB >>

vb datagrid 过滤

有 datagrid1 和 datagrid2显示数据! 
当选中datagrid2的时候,通过选中的某行的字段,截取选中行的第一列的数据!然后过滤datagrid1,我要怎么截呢?

数据库是3个表互相关联的! 
Private Sub DataGrid2_Click() 
Private Sub DataGrid2_Click() 
Adodc1.RecordSource = "select A.gxno,B.gxname from jj_gy_chart as A,jj_gx as B,jj_gy_main as C where A.gxno=B.gxno and C.gyno=A.gyno and A.gyno='" + DataGrid2.SelText = DataGrid2.Text + "'" 
DataGrid2.Row = 1 
Adodc1.Refresh 
Set DataGrid1.DataSource = Adodc1 
End Sub 
End Sub 

报错,为 找未找到存储过程‘false’ 
----------------------------------------------------------------------------------------------------------------------- 
我的意思是上面的语句 
A.gyno='" + DataGrid2.SelText = DataGrid2.Text + "'的"datagrid2."后面要加什么方法截取选中行的第一列数据吖? 
如果是用SelText只能截取那一行的!就不能关联3个表了!我要截取选中行的第一列! 
或者有其他方法吗?紧急.... 
我是新手,请大侠们帮个忙!
补充:VB ,  控件
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,