GetOleDbSchemaTable Table Column Schema from JET MS Access

Public Sub GetDatabaseTableColumns()
Dim table As DataTable
Using cn As New OleDb.OleDbConnection(My.Settings.conStrOneWay)
Dim restrictionValues As String() = New String() {Nothing, Nothing, "Quotes", Nothing}
table = cn.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Columns, restrictionValues)
End Using

Call DisplayData(table)

Catch ex As Exception
Throw ex
End Try
End Sub

Private Sub DisplayData(ByVal table As DataTable)
For i = 0 To table.Rows.Count - 1
Dim msg As String = table.Rows(i)!COLUMN_NAME.ToString & vbTab & table.Rows(i)!DATA_TYPE.ToString
Next i
End Sub



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: