Hi Tim,

The easiest way to determine whether or not a table is open, is as you
mention
your self to use the TableInfo() function, which will give an error if the
table isn't open.

And because this question might be asked over and over again, I would say
that the
best thing to do is to put this question inside a function that returns
TRUE if the table is
open and FALSE if not.

This means that you can use this function in the same way yhat you use
FileExists().

Here is that function:

'**************************************************************************
**************************
'    Is table szTab open
'**************************************************************************
**************************
Function TableOpen(ByVal szTab As String) As Logical

Dim i As Integer

TableOpen = False

OnError GoTo NoSuchTable

     '***If you are asking for the Selection table, this question is
nessessary...
     If szTab = "Selection" Then
          If SelectionInfo(SEL_INFO_NROWS) = 0 Then
               Exit Function
          End If
     End If

     '*** If the table isn't open, an error will occure...
     i = TableInfo(szTab,TAB_INFO_NUM)
     '*** The table is open...
     TableOpen = TRUE

     OnError GoTo 0

     Exit Function

'-------------
NoSuchTable:
     '***The table is NOT open...

End Function
'**************************************************************************
**************************


I hope this will help you on with your project !

Best regards,

Peter

***************************************************************************
*
Peter Moller        [EMAIL PROTECTED]
GIS-Developer       Direct: +45 6313 5008
Kampsax Geoplan     Voice: +45 6313 5013
Rug�rdsvej 55       Faximile: +45 6313 5090
DK 5000 Odense C    Web: www.mapinfo.dk
MapInfo Authorized Partner
***************************************************************************
*


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to