1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private _connection As New OleDbConnection("ChaineDeConnexion")
Private Function GetDbTablesNames(ByVal restrictions As String()) As String()
With Me._connection
If .State = ConnectionState.Closed Then .Open()
With .GetOleDbSchemaTable(OleDbSchemaGuid.Tables, restrictions)
Dim dbTablesCount As Integer = .Rows.Count
Dim dbTables(dbTablesCount - 1) As String
For i As Integer = 0 To dbTablesCount - 1
dbTables(i) = CStr(.Rows(i).Item("TABLE_NAME"))
Next
GetDbTablesNames = dbTables
End With
.Close()
End With
Return GetDbTablesNames
End Function |
Partager