473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Fields in Access database returned in alphabetical order

I'm using the following VB.Net code to retreive the field names of a table
in an Access db:

Dim NewField As ADOX.Column
Dim tblField As ADOX.Column

For Each tblField In adocat.Tables("tblData").Columns
The fields are returned in alphabetical order! I want to have the fields
returned in the order they were created. Can this be done?

-Julian

Mar 11 '06 #1
5 3213
"Julian" <ad***@jdmils.com> schrieb
I'm using the following VB.Net code to retreive the field names of a
table in an Access db:

Dim NewField As ADOX.Column
Dim tblField As ADOX.Column

For Each tblField In adocat.Tables("tblData").Columns
The fields are returned in alphabetical order! I want to have the
fields returned in the order they were created. Can this be done?

-Julian


It is not available in ADOX. Use DAO for native Jet support. See the
Ordinalposition property of the Field object. The DAO docu also says that
two fields can have the same ordinal position. More information:
http://msdn.microsoft.com/archive/de.../D2/S5A2D1.asp
Armin

Mar 11 '06 #2
How do you use DAO in VB.Net?

--
|
+-- Julian
|
"Armin Zingler" <az*******@freenet.de> wrote in message
news:e7**************@TK2MSFTNGP11.phx.gbl...
"Julian" <ad***@jdmils.com> schrieb
I'm using the following VB.Net code to retreive the field names of a
table in an Access db:

Dim NewField As ADOX.Column
Dim tblField As ADOX.Column

For Each tblField In adocat.Tables("tblData").Columns
The fields are returned in alphabetical order! I want to have the
fields returned in the order they were created. Can this be done?

-Julian


It is not available in ADOX. Use DAO for native Jet support. See the
Ordinalposition property of the Field object. The DAO docu also says that
two fields can have the same ordinal position. More information:
http://msdn.microsoft.com/archive/de.../D2/S5A2D1.asp
Armin

Mar 12 '06 #3
Armin Zingler wrote:
"Julian" <ad***@jdmils.com> schrieb
I'm using the following VB.Net code to retreive the field names of a
table in an Access db:

Dim NewField As ADOX.Column
Dim tblField As ADOX.Column

For Each tblField In adocat.Tables("tblData").Columns
The fields are returned in alphabetical order! I want to have the
fields returned in the order they were created. Can this be done?

-Julian



It is not available in ADOX. Use DAO for native Jet support. See the
Ordinalposition property of the Field object. The DAO docu also says
that two fields can have the same ordinal position. More information:
http://msdn.microsoft.com/archive/de.../D2/S5A2D1.asp

Armin


You can get it in ADO which is the .net way of doing things. There is a
function on the connection or command object called gettableschema that
will get you the info you want.

Chris
Mar 12 '06 #4
"Chris" <no@spam.com> schrieb
It is not available in ADOX. Use DAO for native Jet support. See
the Ordinalposition property of the Field object. The DAO docu
also says that two fields can have the same ordinal position. More
information:
http://msdn.microsoft.com/archive/de.../D2/S5A2D1.asp

Armin


You can get it in ADO which is the .net way of doing things. There
is a function on the connection or command object called
gettableschema that will get you the info you want.

I thought ADOX is even closer to DAO than ADO.Net. Therefore I did
not even think of doing it in ADO.Net. But your probably right.
Armin

Mar 12 '06 #5
"Julian" <ad***@jdmils.com> schrieb
How do you use DAO in VB.Net?

Set a reference to "Microsoft Data Access Objects". But you should probably
better have a look at Chris' answer.

See also: System.Data.OleDb.OleDbConnection.GetOleDbSchemaTa ble

and

http://msdn.microsoft.com/library/en...mns_rowset.asp
Column "ORDINAL_POSITION"

http://msdn.microsoft.com/library/en...t_overview.asp
especially
http://msdn.microsoft.com/library/en...ma_rowsets.asp

Armin

Mar 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: AAVF | last post by:
Hi We have a problem with a query. An Access database links via ODBC to a UNIX server. To speed things, we use the ODBC to load the relevant tables to the local PC that runs Access so that...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
2
by: Cro | last post by:
Dear Access Developers, I am developing a form with 'default view' set to "continuous forms". I am suffering with a problem I can't yet see a solution too. Each record has many fields. Two...
3
by: alex_peri | last post by:
Hello All, I am having problems with sorting a recordset by fields in Access. I have a table with three columns called ID, SNo and Time and would like to sort the records by Time. I would like to...
3
by: tesc | last post by:
I am so aggravated and need any help I can get. I am using Access 2000 and am trying to sort multiple fields in a select query. My query is set up as follows: FIELD 1 FIELD 2 FIELD 3 ...
6
by: Brian | last post by:
Hello, Basically, I'm running a query on a form's activation, and I'd like to have the results of the query be placed into other fields on the same form automatically. Does anybody know how...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
3
by: Danzak | last post by:
Can anyone out there help me with a problem I’m having? I have a database with 10117 records in it. Each record is numbered from 0001NHP to 10117NHP. Sometimes I have the database in alphabetical...
1
by: Webstorm | last post by:
Hi, I hope someone can help me sort this out a bit, Im completely lost. Here is the page I am working on: http://www.knzbusinessbrokers.com/default.asp I have 3 search critera that I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.