L
Lespaul36
I am working on a program to convert access databases. I need to get a list
of the tables, fields, and field types.
I have tried this code, but didn't get anything other than a cound of how
many tables there are.
Function GetTables(ByVal conn As OleDbConnection) As DataTable
conn.Open()
Dim schemaTable As DataTable =
conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
New Object() {Nothing, Nothing, Nothing, "TABLE"})
conn.Close()
Return schemaTable
End Function
I also tried using the SQL:
SELECT Name FROM MSysObjects
WHERE Type=1 AND Flags=0
But I guess you need to change permission on the databases and I am not sure
how to do that programically. Also not all of the databases have the hidden
tables.
Any help would be great. thanks
of the tables, fields, and field types.
I have tried this code, but didn't get anything other than a cound of how
many tables there are.
Function GetTables(ByVal conn As OleDbConnection) As DataTable
conn.Open()
Dim schemaTable As DataTable =
conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
New Object() {Nothing, Nothing, Nothing, "TABLE"})
conn.Close()
Return schemaTable
End Function
I also tried using the SQL:
SELECT Name FROM MSysObjects
WHERE Type=1 AND Flags=0
But I guess you need to change permission on the databases and I am not sure
how to do that programically. Also not all of the databases have the hidden
tables.
Any help would be great. thanks