Solved

XML Import Export (Data Mapper)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 66
VB6 - Compare and highlight cell not the same 3 43
using web browser with BING 40 110
vbModal 12 35
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

14 Experts available now in Live!

Get 1:1 Help Now