Database.IndexSchema

From Xojo Documentation
Jump to: navigation, search
Method

Database.IndexSchema(TableName as String) As RecordSet

Returns a RecordSet containing the list of indexes for the passed TableName. Returns Nil if the table has no indexes or the database source does not support indexes.

The RecordSet returns one row for each index on the table and it has one field: IndexName As String.

Notes

The RecordSet result has a single column:

  • IndexName: A string containing the name of the index.

Example

This example displays the indexes for the "Invoices" table (if it exists) in the specified SQLite database:

Dim dbFile As FolderItem
dbFile = GetOpenFolderItem("")

If dbFile <> Nil Then
Dim db As New SQLiteDatabase
If db.Connect Then
Dim indexRS As RecordSet
indexRS = db.IndexSchema("Invoices") // A table with indexes in the SQLite DB
If indexRS <> Nil Then
While Not indexRS.EOF
MsgBox("Index: " + indexRS.IdxField(1).StringValue)
indexRS.MoveNext
Wend
indexRS.Close
End If
End If
End If
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About