Database.Tables

From Xojo Documentation

Revision as of 16:09, 12 January 2022 by Gperlman (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

Database.Tables() As RowSet

New in 2019r2

Supported for all project types and targets.

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

See Also

Database.TableColumns method