Application.GetDatabaseTables
Method: GetDatabaseTables(pImportSettings as DatabaseConnection) as ElementList
Description
GetDatabaseTables reads the table names from the database specified in pImportSettings. Properties mandatory to be filled out for the database connection are one of DatabaseConnection.File, DatabaseConnection.ADOConnection and DatabaseConnection.ODBCConnection. All other properties are ignored.
The function returns a collection of ElementListItems where the properties ElementListItem.Name contain the names of tables stored in the specified database. The remaining properties of ElementListItem are unused.
Errors
1111 | The application object is no longer valid. | |
1100 | Invalid parameter or invalid address for the return parameter was specified. | |
1112 | Invalid database specified. | |
1113 | Error while reading database table information. | |
1118 | Database table query failed. |
Example
Dim objImpSettings As DatabaseConnection
Set objImpSettings = objSpy.GetDatabaseSettings
objImpSettings.ADOConnection = TxtADO.Text
'store table names in list box
ListTables.Clear
Dim objList As ElementList
Dim objItem As ElementListItem
On Error GoTo ErrorHandler
Set objList = objSpy.GetDatabaseTables(objImpSettings)
For Each objItem In objList
ListTables.AddItem objItem.Name
Next