我可以从 FoxPro 通用字段中提取文件吗?
我正在将 VFP 9 应用程序移植到 SQL Server。 VFP 应用程序有一些表,其中包含“常规”字段。 查询字段时我得到一个字节数组,当我将它保存到磁盘时,我可以查看里面并看到它是一个word文档,或者一个Paint BMP等。
通过阅读,我发现通用字段是一个专有格式并包含文档预览的缩略图(除其他外,我确信)。
有人可以向我指出一些代码,该代码首先提取文件类型,然后提取我可以保存为原始文件的实际文件数据。 (获取预览图像也很好。)
显然,在过去,有人在 Foxpro 中编写了一个名为 GENTOFIL.PRG 的程序,听起来它将通用字段转换为文件。 但是,当试图找到它时,谷歌并没有多大帮助!
I'm porting a VFP 9 application to SQL Server. The VFP app has some tables with "general" fields in them. I get a byte array when query the field, and when I save it to disk, I can look inside and see it's a word document, or a Paint BMP, etc.
From reading around, I've found that the general field is a proprietary format and contains a thumbnail image of the preview of the document (amongst other things, I'm sure).
Can somebody point me to some code that would extract firstly the type of file, and then the actual file data that I can save as the original file. (Getting the preview image out would be nice too.)
Apparently back in the day, somebody wrote a program in foxpro called GENTOFIL.PRG which sounds like it converts general fields to a file. But, google doesn't help much when trying to find that!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您知道“常规”字段的内容是一个 Word 文档,我有一些应提取它的人推荐的 Visual FoxPro 代码。
如果您需要帮助从表中提取图像,您可以查看我过去使用过的 Microsoft 知识库文章。
http://support.microsoft.com/kb/894819
里克·舒默
Visual FoxPro MVP
If you know the content of the General field is a Word Document I have some Visual FoxPro code recommended by someone that should extract it.
If you need help extracting an image out of the table you can check out a Microsoft KB article I have used in the past.
http://support.microsoft.com/kb/894819
Rick Schummer
Visual FoxPro MVP
VFP 中的“常规”字段类型有点奇怪...
来自 VFP 帮助文档:
这里要注意的关键是,VFP 的“常规”字段类型处理 Microsoft OLE 对象,它们可以链接或嵌入< /em>。 此外,VFP 直接操作 OLE 对象的能力似乎很小,因为当对包含的 OLE 对象调用操作时,实际上会运行关联的应用程序来打开/编辑 OLE 绑定的“常规”字段的内容。
正如您所说,如果您能够手动提取文件,这可能是提取文件的最佳方法,因为即使 VFP 也提供了与通用类型字段中包含的数据进行交互的最少方法。
The "General" field type in VFP is a bit of an oddity...
From the VFP Help docs:
The key thing to note here is that the "general" field type of VFP deals with Microsoft OLE objects and they can be either linked or embedded. Also, VFP's ability to directly manipulate OLE objects appears to be minimal because when invoking actions on contained OLE objects, the associated application is actually run to open/edit the contents of the OLE-bound "general" field.
If, as you have said, you are able to extract the file by hand, that's probably the best way to go about getting the files out, as even VFP provides minimal ways to interact with the data contained in general type fields.