Solved

XML Import Export (Data Mapper)

Posted on 2004-09-23
7
156 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now