Hey all, is there a way to return all the column names from an access table, i can do it in SQL by using the masters sp_columnnames stored proc, however for this project were using a access database
Printable View
Hey all, is there a way to return all the column names from an access table, i can do it in SQL by using the masters sp_columnnames stored proc, however for this project were using a access database
After initializing the connection obj and datast , and oleadapter , do it this way :
VB Code:
Dim adp As New OleDbDataAdapter Dim ds As New DataSet adp.Fill(ds, "YourTableName") Dim ColumnCount = ds.Tables("YourTableName").Columns.Count For i As Integer = 0 To ColumnCount MessageBox.Show(ds.Tables("YourTableName").Columns(i).ToString) Next
MySql has a command SHOW COLUMNS, but don't think Access has an equivalent.
If I'm not wrong , there is another way to get column names by Table Schema .