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

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
¤ 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)
 
Back
Top