xml formatting and handling of keys

jjh

Registered User.
Local time
Today, 16:04
Joined
Jun 7, 2006
Messages
32
When I export my access database to XML I noticed that the XML elements for the table keys contain the key numbers themselves, not the table name (or a chosen field in the table). For an application I am working on, this presents a problem. What I have is:

One table called 'Process' that looks like:

Process instance_id System instance Id Process name
26 24 Two_thread_process


I have another table called "Thread":

Thread _instance_id Process instance_Id Thread instance name
30 26 T1_instance


XML export looks like:

- <process_INSTANCE>
<process_instance_id>26</process_instance_id>
<system_instance_name_id>24</system_instance_name_id>
<process_instance_name>two_thread_process</process_instance_name>
- <thread_INSTANCE>
<Thread_instance_id>30</Thread_instance_id>
<process_instance_id>26</process_instance_id>
<thread_instance_name>T1_instance</thread_instance_name>
</thread_INSTANCE>
</process_INSTANCE>

What I would *like * the XML to look like is:

- <process_INSTANCE>
<process_instance_id>26</process_instance_id>
<system_instance_name_id>24</system_instance_name_id>
<process_instance_name>two_thread_process</process_instance_name>
- <thread_INSTANCE>
<Thread_instance_id>30</Thread_instance_id>
<process_instance_id>two_thread_process</process_instance_id> (**name instead of key here**)
<thread_instance_name>T1_instance</thread_instance_name>
<thread_instance_type>periodic</thread_instance_type>
</thread_INSTANCE>

The access XML export writes out the key values as they appear in the tables. What I would like is for it to put in the ‘process instance name’ instead of the key that points back to the base (process) field.
Any pointers on how I could do this?

Thanks
John
 
Export a query rather than the table. Make sure that your query selects the text field rather than the key field.
 
I dont get it...

Pat Hartman said:
Export a query rather than the table. Make sure that your query selects the text field rather than the key field.

Sorry, I don't get it.....If I create a query on the root table, so to speak, I have the option of including any of the ID fields (where keys are kept). If I don't select the key field, I don't have the reference back to the referring table. (I want to keep the reference from the referring table, - but I want the referring table name, not the key number....

John
 
You need to include both the main table and the lookup table in the query. If your tables are properly related, Access will automatically draw the necessary join line. Otherwise, you need to. Select the fields you need from the main table but instead of selecting the "key" to the lookup table, select the "text value" from the lookup table.
 

Users who are viewing this thread

Back
Top Bottom