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

↘锁芯ラ 提交于 2019-12-08 04:36:08

问题


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.

回答1:


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.



来源:https://stackoverflow.com/questions/7812537/adodataset-how-to-load-xml-saved-beforehand-in-db-in-ado-schema-data-without

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!