怎样判断一个数据库中的表是否打开了?

解决方案 »

  1.   

    我一般在打开记录集的时候判断其是否打开
        With Rs
            If .State = adStateOpen Then   ‘如果是打开,我就先关闭
                .Close
            End If
            .ActiveConnection = CN
            .CursorLocation = adUseClient
            .CursorType = adOpenDynamic
            .LockType = adLockBatchOptimistic
            .Source = "SELECT * FROM table "
            .Open
        End With
      

  2.   

    Dim Rs As New ADODB.Recordset