Solved

XML Import Export (Data Mapper)

Posted on 2004-09-23
7
162 Views
Last Modified: 2010-05-02
We have an application and the database for it is user customisable.  We need to be able to import and export data to various 3rd parties in their specific format.

In essance what we need is for a user to be able to select a .xml or xsd file and then map their fields to that document.
We can then store this "Template" in our database, and the next time they want to import or export an xml file that can just select a the file an a "Template" and it will do the rest for them.

I hope this is clear.

Any clues as to how I could achive this would be a great help.
0
Comment
Question by:sajohnstone
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
fds_fatboy earned 125 total points
ID: 12133908
Create a view on your DB with the columns that can be selected.

create this table

tblColumn
    ColumnId (PK)
    ColumnName

place a row in it for each of the columns in the view

Create these tables

tblTemplate
    TemplateId (PK)
    templateName

tblTemplateColumn
    TemplateId (FK to  tblTemplate)
    ColumnId (FK to  tblColumn)


Put a textbox and multi-select listbox on a form and populate it with the contents of tblColumn. Allow your customers to enter the name of a template in the textbox and select fields from the listbox. When they save create a new row in tblTemplate and loop through the listbox getting the keys to create rows for tblTemplateColumn.

In anotherform allow the user to select a previously created template. Create a stored procedure to create a dynamic SQL Select statement to get data from the initial view.

Sorry this is sketchy but that's the nest I can do with the information provided.

Now back to work.
0
 

Author Comment

by:sajohnstone
ID: 12134161
Thanks for the response fds_fatboy.

What I need to know is how to do the XML part.  

How to read a xsd/dtd/xml file into a format that could be turned in to a template.
How to then turn that template into an xml file (that matches the dtd/xsd if provided).
How to read a imported xml file against the template and hence map the fields to our database

I can't help thinking there must be an SDK or something out there that does this allready as I imagine that this is a fairly common request.
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12134926
Well there's this one from microsoft.

http://msdn.microsoft.com/XML/XMLDownloads/default.aspx

It's very easy to use with VB. Also, if you are using dotNet check out ADO.Net - loads of XML in there - What DB are you using?
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12565157
Well I think we were on the way to a solution but then sajohnstone just buggered off. Looking at his/her profile, 1 question/1 comment not bothering to answer questions. I think he/she is gone for good.

Never mind.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question