例如DBGrid、MSHFLexGrid或者其它的什么控件,可以在其中显示来源于多个数据库(即多个Table或RecordSet)的数据吗?即不同的列来自不同的数据库,但它位之间有一定的联系,例如某一个字段相同。

解决方案 »

  1.   

    可以,用SQL语句非常好实现,如有二表,student,scores
    sql="select student.ID,scores.English from student,scores where student.ID=scores.ID"
    student和scores中都一相同字段,用他们来关联
    rs.open sql,cnn
    set datagrid1.datasource=rs来显示
      

  2.   

    当然可以,用sql的多表查询就可以做
    Dim strtmp as String
    strSQL = "select c.formcat3_name from tblformcat3 c ,tblformcat2 b where b.valid_flag = 1 and c.valid_flag = 1 and c.formcat2_code = b.formcat2_code and b.formcat2_name = "
    strSQL = strSQL & "'" & strtmp & "'"
    rst.open strSQL,conn