用哪个函数或属性,请最好给出代码,初学,谢谢大伙先!

解决方案 »

  1.   

    你判断它的数据源有没有记录就行了
    打开记录集前加
    On Error GoTo endline
      打开记录集
       用Adodc加
       Adodc1.MaxRecords<>0
       用DATA加
       Data1.Recordset.RecordCount<>0
       关闭记录集
    End:
      

  2.   

    if adodc1.bof or adodc1.eof then
      

  3.   

    for iRow=0 to datagrid.Rows
       for iCol=0 to datagrid.Cols
           if datagrid.text=""then msgbox"DATAGRID中存在记录"
       next iCol 
    next iRow   
      

  4.   

    不好意思,写错了
    if datagrid.text<>"" then ....
      

  5.   


    楼上的不正确!
    datagrid.Cols 没有这属性------------------------------------------------------------------
    个人专栏:http://www.csdn.net/develop/author/netauthor/lihonggen0/
    ------------------------------------------------------------------   If DataGrid1.ApproxCount = 0 Then
            MsgBox "没有记录!"
       End If
      

  6.   

    你也可以判断与其相关的rs的记录数Rs.RecordCount