ADODataset:如何在没有临时文件的情况下加载XML(在ADO模式中预先存储在DB中)数据? [英] ADODataset: how to load XML (saved beforehand in DB in ADO schema) data without temporary files?

查看:94
本文介绍了ADODataset:如何在没有临时文件的情况下加载XML(在ADO模式中预先存储在DB中)数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:完全重写。

场景:

我从TCustomADODataset后代的数据库中加载了一些数据。之后,我将此数据保存在XML临时文件中(使用TCustomADODataset.SaveToFile),以允许将XML数据作为字符串获取,并将其作为文本Blob存储在数据库表中-这是一个导出表。

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.

另一个程序(与存储XML的程序不同)将获取该数据,显示其中的元素,并允许用户选择要导入到主元素的元素数据库模式。

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.

问题:

上述方法的问题是需要临时文件以允许TCustomADODataset使用LoadFromFile方法。

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

还有其他方法可以将存储在数据库导出表中作为文本存储的XML数据加载到不需要临时文件的TCustomADODataset中吗?

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?

注意:


  • 在这种情况下,TClientDataset不是选项 strong>。

  • TClientDataset is not an option in this case.

推荐答案

选中示例。它可能正是您要寻找的。使用该示例中的 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 your TCustomADODataSet.Recordset property.

这篇关于ADODataset:如何在没有临时文件的情况下加载XML(在ADO模式中预先存储在DB中)数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆