ImportXML and row order (Access 2002)

C

C M Shaw

I am attempting to import a table into Access from an XML file. I am
working programmatically from VB.NET (calling objAccess.ImportXML),
but I see the same problem when I open Access and manually import the
XML file. The schema and data are importing correctly either way.

The problem is this: the rows in the imported table are not in the
same order as they were in the XML file. Blocks of rows seem to be
randomly shifted earlier or later in the row sequence -- the shifting
is not the same between two manual instances of importing the XML
file, although I see the same reordering each time I import
programmatically. It doesn't look like the rows have been resorted on
a different column; it's definitely blocks of rows shifted.

It's very important that these rows remain in order, and I would
prefer not to have to programmatically resort the table after
importing the data. Can anyone tell me what's going on?

Thank you,
Caitlin Shaw
(e-mail address removed)
 
R

Rick Brandt

C M Shaw said:
I am attempting to import a table into Access from an XML file. I am
working programmatically from VB.NET (calling objAccess.ImportXML),
but I see the same problem when I open Access and manually import the
XML file. The schema and data are importing correctly either way.

The problem is this: the rows in the imported table are not in the
same order as they were in the XML file. Blocks of rows seem to be
randomly shifted earlier or later in the row sequence -- the shifting
is not the same between two manual instances of importing the XML
file, although I see the same reordering each time I import
programmatically. It doesn't look like the rows have been resorted on
a different column; it's definitely blocks of rows shifted.

It's very important that these rows remain in order, and I would
prefer not to have to programmatically resort the table after
importing the data. Can anyone tell me what's going on?

Sorry, *tables* in a relational database have no order. They are "buckets of
data". If you need a particular order this has to be established by sorting on
the data using a query with an order by clause.
 
C

C M Shaw

Rick Brandt said:
Sorry, *tables* in a relational database have no order. They are "buckets of
data".

True enough, from a database standpoint. I'm trying to use the
resulting MDB as a datasource for an MS Word mail merge, though, which
picks up the physical order of the rows in the table. (I can't use
the XML itself as the datasource because it's too slow for large
merges.) Do you have any suggestions?

Thank you,
Caitlin Shaw
(e-mail address removed)
 
R

Rick Brandt

C said:
True enough, from a database standpoint. I'm trying to use the
resulting MDB as a datasource for an MS Word mail merge, though, which
picks up the physical order of the rows in the table. (I can't use
the XML itself as the datasource because it's too slow for large
merges.) Do you have any suggestions?

Thank you,
Caitlin Shaw
(e-mail address removed)

Yeah, like I said before...use a query. You can do a mail merge with a
query just as easily as with a table.
 

Ask a Question

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.

Ask a Question

Top