Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
raj raj is offline
external usenet poster
 
Posts: 32
Default Access field order using ADO

Please help if possible.

I need to retrieve the field names in an Access database
using ADO, BUT, I need them in the order in which they
appear in the database from left to right.

It seems that the code I'm using alphabetizes them. Your
example code would be MOST appreciated. Thanks in advance.

My code follows:

Function ADOAccessFieldList(argFullName As String,
argTableName As String)

Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
Dim fld As ADOX.Column
Dim flds As ADOX.Columns
Dim arrFields() As Variant
Dim lngX As Long

cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"
& "Data Source=" & argFullName & ";"
Set tbl = cat.Tables(argTableName)
Set flds = tbl.Columns
For Each fld In flds
lngX = lngX + 1
ReDim Preserve arrFields(lngX)
arrFields(lngX) = fld.Name
Next fld
ADOAccessFieldList = arrFields

End Function

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table field selection order Bony Pony[_2_] Excel Discussion (Misc queries) 7 June 12th 09 03:31 PM
Pivot table row field order FJ Excel Discussion (Misc queries) 6 March 11th 07 12:03 PM
I know its not access, but...(tab order) Kycajun Excel Discussion (Misc queries) 5 June 21st 06 07:33 PM
Order of Pivot Drop-Down (Page Field) [email protected] Excel Discussion (Misc queries) 0 March 31st 06 02:01 AM
Pivot Table Ascending Order of Row Field ExcelMonkey Excel Discussion (Misc queries) 1 August 19th 05 12:11 AM


All times are GMT +1. The time now is 11:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"