ADODataset:如何在没有临时文件的情况下加载XML(预先保存在ADO模式的DB中)数据?

发布于 2024-12-10 09:03:31 字数 455 浏览 2 评论 0原文

警告:完全重写。

场景:

我从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埋情葬爱 2024-12-17 09:03:31

查看示例。这可能正是您正在寻找的。使用该示例中的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文