为什么TADOBlobField.Savetofile只写入8个字节
我最近重新访问了一个正在运行的应用程序。
我将文件存储在 MSSQL 数据库的文本字段中。 我将其读入 ADOTable 并作为 TBlobfield 调用 Savetofile 将其写入磁盘上的文件。 这一直有效。 然而现在它只是保存一个 8 字节文件而不是正确的文件。
我对以前发生过这种情况有一个模糊的记忆,想知道是否有人遇到过它并知道解决方案? 我正在使用德尔福7。
I have a working application that I have revisited recently.
I store a file in a text field in a MSSQL database. I read it into an ADOTable and as a TBlobfield call Savetofile to write it to a file on disk. This has always worked. However now it is simply saving a 8 byte file rather than the correct file.
I have a vague memory of this happening before and was wondering if anyone has come across it and knows the solution? I am using Delphi 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
数据库有什么变化吗(服务器/版本升级)? 客户端计算机(XP?Vista?)? 当您调用 SaveToFile 方法时正在保存什么(也许文件只有 8 个字节)? 该字段可以为空/空吗?
我建议不要针对基于集合的 RDBMS(MSSQL、Oracle 等)使用基于表的组件(TTable、TADOTable 等),而使用 TADODataSet 并确保应用了所有 D7/ADO 补丁。
祝你好运
Has anything changed in the database (server/version upgrade)? Client machine (XP? Vista?)? What is being saved when you call the SaveToFile method (maybe the file is only 8 bytes)? Could the field be empty/null?
I would recommend not using table based components (TTable, TADOTable, etc) against a set based RDBMS (MSSQL, Oracle, etc), use TADODataSet and make sure you have all the D7/ADO patches applied.
Good luck
几年前(ado 的旧版本),如果 blob 字段不是查询中的最后一个字段,就会出现问题。 我不知道这仍然是真的
Several years ago (older versions of ado), ther was a problem, if the blob field(s) wasn't the last field in the query. I don't know it that still is true
这个问题是由于我没有应用 Delphi 7 Update 1 直接导致的。
这是 Delphi 7 发行版本中的一个已知错误。
This problem was directly caused by my having not applied the Delphi 7 Update 1.
This is a known bug in the shipped version of Delphi 7.