I'm trying to open a table with the same name but reading from another tab.
I can do this only by first closing the existing table, and afterwards opeing 
the other tab with the same table name.
 
When I use the fillowing lines in the MapBasic Window, this works fine:
  Open Table "C:\...\werkgebied.tab" AS "Werkgebied"
  Close Table "Werkgebied" Interactive
  Open Table "C:\...\agenten.tab" AS "Werkgebied"
  Browse * From Werkgebied

But when I implement this in a MapBasic application as the following method, 
I still get the same error after the table is already closed.
Sub Test()
  OnError Goto CANNOT_OPEN_TABLE
  Open Table "C:\...\werkgebied.tab" AS "Werkgebied"
  Open Table "C:\...\agenten.tab" AS "Werkgebied"
  Browse * From Werkgebied
DONE:
  Exit Sub
CANNOT_OPEN_TABLE:
  If Err()=362 Then
    Note "Catch error 362."
    Close Table "Werkgebied" Interactive
    Open Table "C:\...\agenten.tab" AS "Werkgebied" 'this still results in error
    Resume Next
  End If
End Sub
 
Any idea what I'm doing wrong ?
 
 
Kristof Vydt

Send instant messages to your online friends http://uk.messenger.yahoo.com 

Reply via email to