J
James Quigley
The date being imported is in an ASCII file in a specific field order. I
completed the import and the field order is rearranged. How can I stop this?
completed the import and the field order is rearranged. How can I stop this?
GerryM said:I'm jumping in here because I have the same problem. I am using Access
2003
SP3. The table is created with
Cnn.execute "CREATE TABLE " & Tbl0 & "(" & VFields & ")"
where
VFields = "VID char(15),Tw char(25),Pr char(5), ..." [35 fields, all of
type char(n)]
Then data are inserted with
Cnn.execute "INSERT INTO " & Tbl0 & " VALUES(" & ZT & ")"
where
ZT = "'a','b','c', ..." coming from a text file.
The text file was sorted; the resulting table is no longer sorted.
I would have used the "ORDER BY " feature but I'm sorting on 8 fields and
Access doesn't do the sort right either.
Thanks ahead of time for any suggestions.
Ken Snell MVP said:Tell us some details... how did you do the import? I assume this is from
a
text file? Was the table already set up in your database before you did
the
import? Did you use an import specification? Show examples of data in the
file, and data from the table.
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
Douglas J. Steele said:Never make any assumptions about the order of data in tables. Relational
database theory states that tables should always be treated as unordered
sets.
If the order of the data is important, create a query with the appropriate
ORDER BY clause, and use that query anywhere you would otherwise have used
the table.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
GerryM said:I'm jumping in here because I have the same problem. I am using Access
2003
SP3. The table is created with
Cnn.execute "CREATE TABLE " & Tbl0 & "(" & VFields & ")"
where
VFields = "VID char(15),Tw char(25),Pr char(5), ..." [35 fields, all of
type char(n)]
Then data are inserted with
Cnn.execute "INSERT INTO " & Tbl0 & " VALUES(" & ZT & ")"
where
ZT = "'a','b','c', ..." coming from a text file.
The text file was sorted; the resulting table is no longer sorted.
I would have used the "ORDER BY " feature but I'm sorting on 8 fields and
Access doesn't do the sort right either.
Thanks ahead of time for any suggestions.
Ken Snell MVP said:Tell us some details... how did you do the import? I assume this is from
a
text file? Was the table already set up in your database before you did
the
import? Did you use an import specification? Show examples of data in the
file, and data from the table.
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
The date being imported is in an ASCII file in a specific field order.
I
completed the import and the field order is rearranged. How can I stop
this?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.