Database.Tables
From Xojo Documentation
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site! |
Method
Returns a RowSet with a list of all tables in the database.
Notes
A DatabaseException will be raised if an error occurs.
Tables returns a RowSet with one field: TableName As String.
Sample Code
The following code gets and displays the table names for the connected database:
// App.db is a connected database
Var tables As RowSet
tables = App.db.Tables
Try
For Each row As DatabaseRow In tables
MessageBox(row.ColumnAt(0).StringValue)
Next
tables.Close
Catch error As NilObjectException
MessageBox("This database has no tables.")
End Try
Var tables As RowSet
tables = App.db.Tables
Try
For Each row As DatabaseRow In tables
MessageBox(row.ColumnAt(0).StringValue)
Next
tables.Close
Catch error As NilObjectException
MessageBox("This database has no tables.")
End Try
See Also
Database.TableColumns method