ADODataset:如何在没有临时文件的情况下加载XML(预先保存在ADO模式的DB中)数据?
警告:完全重写。
场景:
我从 TCustomADODataset 后代上的数据库加载了一些数据。之后,我将此数据保存在 XML 临时文件中(使用 TCustomADODataset.SaveToFile),以允许以字符串形式获取 XML 数据并将其作为文本 blob 存储在数据库表中 - 这是一个导出表。
另一个程序(与存储 XML 的程序不同)将获取该数据,显示其中的元素,并允许用户选择将哪个元素导入到主数据库模式。
问题:
上述方法的问题是需要临时文件来允许 TCustomADODataset 使用 LoadFromFile 方法。
还有其他方法可以将数据库导出表中以文本形式存储的 XML 数据加载到不需要临时文件的 TCustomADODataset 中吗?
注意:
- 在这种情况下,TClientDataset 不是一个选项。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看此示例。这可能正是您正在寻找的。使用该示例中的
RecordsetFromXML
,您可以简单地将记录集分配给您的TCustomADODataSet.Recordset
属性。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 yourTCustomADODataSet.Recordset
property.