Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,
I want to get ms-access database table columns data types using with oledb command(that is oledb query) but I don't have an idea. Please help me.

Thanks in advance!!
Posted

From what I know the only way to get table column information is the TableDefs within Access. You can get information about what the tables are if you have access to the system tables. So to get this information, need to program in VBA.
 
Share this answer
 
To find out the data type of each field in an Access table, you can use DAO or ADOX.
VB
Private Sub TableDefDao()

Dim db As DAO.Database
Set db = DAO.OpenDatabase("C:\Users\Julien\Documents\Database2.mdb")

Dim t As DAO.TableDef
Dim f As DAO.Field
For Each t In db.TableDefs
Debug.Print t.Name
    For Each f In t.Fields
        Debug.Print vbTab & f.Name & vbTab & f.Type
    Next
Next
End Sub


it's in VB you can convert to c# from followinf site-
http://converter.telerik.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900