Or do the tables already exist with pre-defined relationships and the import
is destroying them?
--
Joe Fallon
Access MVP
"David Sigmon" <anon...@discussions.microsoft.com> wrote in message
news:2a4001c394d7$c889cf20$7d02...@phx.gbl...
>.
>
Try reversing the problem and build a correct Access database with some
sample data.
Then export it as XML.
Now check out the file structure.
Does the file you are trying to import look anything like that? (I doubt
it.)
Try importing the sample data and see if it goes into the right tables. If
it does then you know the correct format that Access is expecting.
1. Change your XML file to look like something Access is expecting.
2. You can leave your file "as is" but then when you import, consider the
tables it creates to be "staging tables".
Now write Append queries to move the data to the real tables.
--
Joe Fallon
Access MVP
<anon...@discussions.microsoft.com> wrote in message
news:040201c396f7$3b0026a0$a001...@phx.gbl...
Access 2003 (or 2002 for that matter) does not create relationships between
tables when importing from XML. As Joe suggested, when importing arbitrary
XML, Access makes a best guess as to how many tables should be created from
the XML. When importing Access created XML, you should get back the exact
same table structure that was used to export to XML, but the relationships
will be lost.
Regards,
Mike Wachal
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe Fallon" <jfal...@nospamtwcny.rr.com> wrote in message
news:eyt8EK4l...@TK2MSFTNGP12.phx.gbl...
1. If I have an existing table structure with proper relationships and I
export the data to XML and then re-import it the relationships are *still*
present.
(The import does not destroy the relationships.)
2. However, if I import the XML to a NEW .mdb file the tables are built but
the relationships are NOT built.
--
Joe Fallon
Access MVP
"Mike Wachal [MSFT]" <mik...@online.microsoft.com> wrote in message
news:ePnXOEPm...@TK2MSFTNGP10.phx.gbl...
It's probably easier is I give you a set of scenarios and tell you what the
expected results in each case will be:
For each scenario, assume that I started with Table1 and Table2, which are
related to each other. I exported Table1 to XML (table1.xml) and selected
the option in the dialog to also export Table2 using the "Related Tables"
list.
Scenario1: Import table1.xml into my database and use the options to append
the data to the existing Table1 and Table2. (Assume there won't be any weird
key conflicts) The existing relationships between Table1 and Table2 are
preserved.
Scenario2: Import table1.xml in my database and use the option to import
structure and data, which is going to create two new tables. I end up with
tables named Table11 and Table21 (since Table1 and Table2 already exists),
there are no relationships between Table11 and Table21, but all the data is
there.
Scenario3: Import table1.xml into a blank database. I end up with Table1 and
Table2, but there are no relationships between the tables.
So the short answer is that there is no relationship information included in
an XML file, even when you choose to export schema. Since that information
is not in the file, it can not be recreated from the file.
Regards,
Mike Wachal
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joe Fallon" <jfal...@nospamtwcny.rr.com> wrote in message
news:eY1i7cPm...@TK2MSFTNGP12.phx.gbl...
It is exactly as I expected.
Thanks!
--
Joe Fallon
Access MVP
"Mike Wachal [MSFT]" <mik...@online.microsoft.com> wrote in message
news:uQGeSGc...@TK2MSFTNGP09.phx.gbl...
Thanks,
Will
Access supports the use of schemas in two ways:
1) A separate schema file identified within the XML file as such:
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Orders.xsd" generated="2003-11-21T17:48:23">
Note that Orders.xsd is specified as the schema file
2) Schema embedded directly in the XML file.
Access does not read relationship information from the schema nor it does
write relationship information when exporting to XML.
--
Regards,
Mike Wachal
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Will