Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on Get Access Table columns in order they are in in the table

I am trying to get the columns in an Access table in the order that they are in in the table rather than in alphabetical order, that is given using GetOleDbSchemaTable.
How do I loop through DataRowArray in the following code to get through this? If there is a better way t'hen that would be great. Thanks

                'Get the column names in the table.
                Dim SchemaColumn = cn.GetOleDbSchemaTable(schema:=OleDbSchemaGuid.Columns, _
                restrictions:=New Object() {Nothing, Nothing, TableName, Nothing})

                Dim DataRowArray() As DataRow = SchemaColumn.Select(Nothing, "ORDINAL_POSITION", DataViewRowState.CurrentRows)
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown


Thanks very much