Help! How do I get MS Access Field Properties using VB.NET?

G

Guest

Hi there
I am a bit new to vb.net. I have figured out how to use a data reader to get column and row information from my MS Access database using OLEDB. The problem is that while I can easily get the column names, I can NOT seem to get any properties associated with a given col

For example, I have configured specific CAPTIONS in my Access DB that I would like utilize in my vb.net program. Any help would be appreciated
 
C

Cor Ligthert

Hi Dtemlak,

Please do not multipost to dotnet newsgroup, just crosspost than everyone
knows where the message is in.

Send one message to more newsgroups in one time.

Thanks,

Cor
 
P

Paul Clement

¤ Hi there,
¤ I am a bit new to vb.net. I have figured out how to use a data reader to get column and row information from my MS Access database using OLEDB. The problem is that while I can easily get the column names, I can NOT seem to get any properties associated with a given col.
¤
¤ For example, I have configured specific CAPTIONS in my Access DB that I would like utilize in my vb.net program. Any help would be appreciated!
¤

Use the OLEDB provider instead:

Dim DatabaseConnection As New System.Data.OleDb.OleDbConnection
Dim SchemaTable As DataTable

DatabaseConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=E:\My Documents\db1.mdb"

DatabaseConnection.Open()

SchemaTable =
DatabaseConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Columns, _
New Object() {Nothing, Nothing, "Table1"})

DataGrid1.DataSource = SchemaTable

DatabaseConnection.Close()

In addition, some properties are Access specific (such as Caption) and can only be retrieved via DAO
(or possibly not at all).


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top