I am working with Microsoft visual studio 2005.Can anyone tell me how to get table names and column names of a MS access database?
This example is VBA, but it should be possible to translate the idea as it uses ADO.
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = "Provider = Microsoft.Jet.OLEDB.4.0; " _
& "Data Source = MyDB.mdb"
Set rs = cn.OpenSchema( _
adSchemaTables, Array(Empty, Empty, Empty))
Debug.Print rs.GetString
rs.Close
Set rs = Nothing
Similarly to adSchemaTables, adSchemaColumns can be used to return columns. The constraints are TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, so you can see that column data for a specific table can be returned, or all columns and the associated table name. For example:
Set rs = cn.OpenSchema( _
adSchemaTables, Array(Empty, Empty, "Employees", "name"))
Debug.Print rs("TABLE_NAME") & "." _
& rs("COLUMN_NAME") & ": " _
& rs("DATA_TYPE")
For more information see https://msdn.microsoft.com/en-us/library/ms676705.aspx