ADODataset: how to load XML (saved beforehand in DB in ADO schema) data without temporary files?

StackOverflow https://stackoverflow.com/questions/7812537

  •  26-10-2019
  •  | 
  •  

Question

Warning: total rewrite.

Scenario:

I loaded some data from database on a TCustomADODataset descendant. After that, I saved this data on XML temp file (using TCustomADODataset.SaveToFile) to allow getting the XML data as a string and store it on a database table as text blob - it's an exports table.

Another program (different from the one that stored the XML) will take that data, show the elements inside, and allow an user to select which element to import to the main database schema.

Problem:

The problem with the approach above is the need of temporary files to allow TCustomADODataset use the LoadFromFile method.

There's any other way to load that XML data stored as text in the database exports table into a TCustomADODataset that don't need temporary files?

Notes:

  • TClientDataset is not an option in this case.
Was it helpful?

Solution

Check this example. It is probably exactly what you are looking for. Using the RecordsetFromXML from that example you can simply assign the recordset to your TCustomADODataSet.Recordset property.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top