Populating database tables from XML

I have a question concerning both ADO and XML, so I have posted in
both these groups...

Scenario:
We have a database system where we have published a user interaction
interface in the form of a number of accessible database tables and a
conversion program that is used to move user data from the public
tables into the internal structures of the closed part of the
database.
The users are supposed to program their own data interface using the
public tables and some examples we have documented using VB code.

Development task:
Now we want to expand this such that the users are no longer forced to
do a connect to our database and active table manipulations in their
own code. Instead we are thinking of using XML instead, such that the
users create an XML structure mirroring the public database tables and
then we supply a conversion program that can take the XML as input
data and then push this into our database. Since XML is apparently so
popular this would presumably simplify the customer interface efforts.

The snag is that we do not use XML ourselves so we really do not know
exactly how to go about this...

So could someone here explain what we need to do to move data from an
XML file into the structure of our database tables using Delphi 7 (or
possibly BDS2006)??
What needs to be defined in the XML file and is there some "magic"
automated way to push all of the XML file data into our public tables
so we can then use our existing software to do the remaining part ofg
the conversion?
The database server is Microsoft SQL Server and we use ADO from within
Delphi 7 to work with the databases.
0
Bo
12/21/2008 9:40:37 PM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

1 Replies
1033 Views

Similar Articles

[PageSpeed] 36

You can save an ADO dataset to an XML file
Use the AdoDataset.savetoFile  method and give the file name an '.XML' extention.
This will give you an XML file of the correct format

You can also load an XML File to an ADOdataset with the loadFromFile method.
This will get yoiu an ADO in memory dataset.
You could itterate through this dataset and add records to your production database.
You may also want to look at the ADO briefcase project that should be one of the Demo applications that came with Delphi 7

There are also some 3rd party Delphi Import utlities you could use.  SMImport www.scalabium.com is the one I use




> {quote:title=Bo Berglund wrote:}{quote}
> I have a question concerning both ADO and XML, so I have posted in
> both these groups...
> 
> Scenario:
> We have a database system where we have published a user interaction
> interface in the form of a number of accessible database tables and a
> conversion program that is used to move user data from the public
> tables into the internal structures of the closed part of the
> database.
> The users are supposed to program their own data interface using the
> public tables and some examples we have documented using VB code.
> 
> Development task:
> Now we want to expand this such that the users are no longer forced to
> do a connect to our database and active table manipulations in their
> own code. Instead we are thinking of using XML instead, such that the
> users create an XML structure mirroring the public database tables and
> then we supply a conversion program that can take the XML as input
> data and then push this into our database. Since XML is apparently so
> popular this would presumably simplify the customer interface efforts.
> 
> The snag is that we do not use XML ourselves so we really do not know
> exactly how to go about this...
> 
> So could someone here explain what we need to do to move data from an
> XML file into the structure of our database tables using Delphi 7 (or
> possibly BDS2006)??
> What needs to be defined in the XML file and is there some "magic"
> automated way to push all of the XML file data into our public tables
> so we can then use our existing software to do the remaining part ofg
> the conversion?
> The database server is Microsoft SQL Server and we use ADO from within
> Delphi 7 to work with the databases.
0
Brian
12/23/2008 12:11:31 AM
Reply:

Similar Artilces:

Populating a database table
I am doing a one time data migration from two database tables into one. string queryString = "SELECT MR.MR_Auto_Number, MR.Project_Name, MR.Project_Type,  MRD.Audience, MRD.Duration FROM MRBasics MR, MR_Details MRD WHERE MR.MR_ID *= MRD.MR_ID";using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DConnectionstring"].ConnectionString)) {SqlCommand command = new SqlCommand(queryString); command.Connection = connection; connection.Open();SqlDataReader reader = command.ExecuteReader();   GridView1.DataSource = read...

Populate XML file from database?
I basically need to build an xml file somehow that will populate from an SQL database (using C#), so flash can read that XML file to populate the flash textbox with the data.  I just can't figure out how to make an XML file that will load from the database?  Once I get that working, I believe I'll be able to get flash to read the XML file ok. Overall, I'm just trying to get flash to load data from the database...but it looks like I have to accomplish this through an XML file.  I looked into flash remoting a little, but my host (discountasp.net) said thei...

How to Populate an XSD table from XML?
Hello I have designed a few table schema into an XSD file. Now I need to use this XSD as a DataSet and need to populate those XSD tables from XML files. I tried DataSet.ReadXml() but it does not populate the tables and does not give exceptions. Could anyone give me a hyperlink to some site where I can design a table schema into XSD then be able to populate it from XML? Thank You. - Jasem Jasem Al-ShamlanInternet Applicationshttp://i.com.kwKuwait If your XML validates with the schema of the DataSet, it should load fine. It seems like you're trying to load an XML file that ...

Link FoxPro Database table to SQL Server Database table
I have LAN Server in witch Visual Foxpro Database reside.I have another remote server in witch SQL Server 2005 installed.I want to link Foxpro table to SQL Server Database Table.Is it possible? Can please someone help? Thanks MS...

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

a little help with transfering table A in Database A into table B in database B
I can't seem to find a good tutorial in transfering data from one table in database a into a different table in database b. The catch is that the fields in the tables don't match exactly. How can I do this? Examples, tutorials, etc are greatly appreciated.Thanks!Graphfixz Data & Web Designhttp://www.graphfixz.com All you need is INSERT INTO with column list that will give you control of how you the the insert into the new database, the other option was to use DTS.  Try the link below for the INSERT INTO statement.  Hope this helps.http://msdn.microsoft.com/library/def...

Advice: XML file as database or table
Hello, If I choose to use a database then I need to use multiple tables. With a XML file I can select "my objects" as once. I think that there will be around 10.000 records (objects). I want to select my objects on different (selection criteria) ways (on attributes). And I want to add, update and delete my objects. Can somebody tell me if it is a good idea to use a XML file as database or table? Can I read parts of a XML file (for paging purpose)? Or do I need to select everything at once? Thanks!Please remember to 'Mark as Answer' if this post answered your ...

Populate Checkboxlist from xml, then save to database
Has anyone ever populated a checkboxlist from an xml file, then saved the users choices to a database? Then pulled that saved data out again for editing? I'm trying to create a list of items a user can select multiple options from for their membership profile (ie interests, hobbies) I intend to be updating the list of options often, so I'd like to use an xml so I don't have to add to the database. VB code?  You can do it really cool using XSL, but it is kind of difficult. This guys have solution: http://forums.asp.net/t/1123467.aspx And then u can easily save your data...

How to populate drop down from access database table
Hi, I have an access database with a table which contains motor vehicle details, e.g. make, model, colour etc I want to create a drop down which is populated by the make field in my database e.g. FORD, PEUGEOT CITROEN etc. How do I do it? For info there will be more than one of each make in the table. Thankyou Ben Durkin MCP MCSA MCSE, Currently learning VB.NET and ASP.NET Burnley, England Try using the following select statement: select distinct make from Cars This will give you every unique value for the field make through the whole table. Once you have that in a data r...

Loading XML data into database table
I'm having some problems loading XML data into database table using openXML.  Here's the sp:1 DECLARE @hDoc int 2 EXEC sp_xml_preparedocument @hDoc OUTPUT, @xmldata 3 4 INSERT INTO table1 5 SELECT 6 COL_1, 7 COL_2, 8 COL_3 9 FROM OPENXML(@hDoc, '/ROW', 2) 10 WITH ( 11 COL_1 char(3), 12 COL_2 char(3), 13 COL_3 decimal 14 ) 15 16 EXEC sp_xml_removedocument @hDoc   Here's the table structure: COL_1 char(3) COL_2 char(3) COL_3 decimal(4,1)   Here's the XML file:1 <ROW> 2 ...

Populating Html table thru database
Hi, Which more efficient and reliable ?Populating label thru database and assigning to html table or Populating variable thru database and assigning to html table. Hope I am clear.   Thanks   Warm RegardsKumar Harsh Hello, I'm not really sure, but I think it's lightweight constructing your table like a textstring with pure html and then just display it through a label. BUT, what I usually do is add the table dynamically, and then this table add to a placeholder. This gives me more control and a better birds eye view when it's time ...

populate the names of table dynamically from the database
Hi all, I want to populate the names of the table dynamically from the database and bind it to the treeview and when i click on the table name in the treeview all the rows of that table should be displayed in the gridview dynamically. Thanks in advance, Regards, Ramesh Rathi HI..When you click on the TreeView now..get the Click Item Name & pass it into Query...For instance,String Q = "select * from " + TRIVIEW SELECT NODE VALUE WHILE IS YOUR TABLE NAME";Write Procedure to bind the GridView.But remember one thing AutoGenerateColumns="true" ."A conclusio...

How to update a database table with an xml file
I will be receiving an XML file via file upload (I will create that with no problems).  After the file is uploaded, I would like to update a database table with the data I just received from the XML file.  I am at the very beginning of learning this.  I know how xml works, how to create an xml file, and how to read them.  I do not know, however, how to connect to an xml file as a datasource or if that is even the way to do it.  I am guessing there is some sort of xml reader necessary to accomplish this, but I have no idea on where to start. Does anyone know of some...

Web resources about - Populating database tables from XML - embarcadero.delphi.ado

Koalas over-populating Great Ocean Road 'fell out of trees due to starvation'
A koala expert says the culling of more than 700 koalas was necessary because they were "falling out of the trees due to starvation".

Apple begins populating international iBookstores - iLounge News
According to a report from Italian language iPadevice (Translated Link), Apple has begun populating the iBookstores of Australia, Canada, France, ...

Disney is populating their theme parks with robots that can THROW THINGS AT YOU
Disney is hard at work bringing about the Robopocalypse. Behold the throwing bots, the brand-new batch of robots Disney can't wait to unleash ...

Cavuto on Bartiromo at FBN: ‘We’re Populating it with Italians’
Neil Cavuto went on Brian Kilmeade ‘s Fox News Radio show today to talk about the addition of Maria Bartiromo to the FBN line-up. “We’re populating ...

Starbucks Plans to Begin Populating India at Last
Starbucks, the popular American coffee retailer, plans to open its first store in India in September through a joint venture with Tata Global ...

American cougars are re-populating their historical range
American mountain lions, or cougars, are re-emerging in areas of the United States, reversing 100 years of decline. The evidence, [...

Cougars are re-populating their historical range, new study confirms
American mountain lions, or cougars, are re-emerging in areas of the United States, reversing 100 years of decline. The evidence raises new conservation ...

Populating DeLong: Long Form
I have now populated [DeLong: Long Form](http://delong.typepad.com/delong_long_form/) from the present back through the start of 2012for those ...

Cougars are re-populating their historical range, new study confirms
American mountain lions, or cougars, are re-emerging in areas of the United States, reversing 100 years of decline. The evidence, published in ...

Seattle’s unlikely hero? How RealNetworks sparked the region’s startup community
... such as Amazon.com and Microsoft. But the DNA of another company has had a surprising impact on the Seattle startup ecosystem, populating dozens ...

Resources last updated: 12/8/2015 12:25:07 AM