在SQL中使用VBA代码存储BLOB [英] Storing BLOB with VBA code in SQL

查看:82
本文介绍了在SQL中使用VBA代码存储BLOB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我在将图像作为Blob存储在SQL链接表中时遇到问题.我们的系统使用Access 2002前端并链接到SQLServer2000数据库.我有一个表格,希望为每个客户记录显示唯一的客户jpeg照片.我们的客户HIPAA问题意味着我们必须在数据库字段中存储映像而不是路径.我在窗体上使用图像控件.最初,我已经能够将Windows对话框中的图像加载到控件中,并且可以毫无问题地保存路径.

I am having a problem storing an image as a Blob in a SQL linked table. Our system uses an Access 2002 frontend and linked to a SQLServer2000 database. I have a form that I want to display a unique client jpeg photo for each client record. Our client HIPAA concerns means we have to store the image not the path in the database field. I am using an Image control on the form. Initially I have been able to load an image from a Windows Dialog into the control and save the path no problem.

我的问题围绕着如何在从对话框中将图像加载到窗体后,如何将jpeg作为BLOB实际保存和加载到VBA字节数组中.(是否需要某种二进制转换或追加?和GetChunk方法处理所有这一切)?:

My issues are surrounding how to actually save and load the jpeg as a BLOB in a VBA byte Array after the image has been loaded to the form from the dialog box.(Is there some sort of binary conversion needed or does the Append and GetChunk methods handle all this)?:

我在该主题上能找到的所有代码示例都有一行代码,可使用此语句将Image控件的数据源设置为打开的记录集--->设置imgDBImage.DataSource = rs.由于DataSource不会显示为Access 2002 Image Control的属性,因此该语句是否与VBA一起使用?那么如何将图像控件指向VBA代码中包含BLOB的表字段?

All the code examples I have been able to find on the subject have a line of code to set the Image control's data source to the open recordset with this statement ---> Set imgDBImage.DataSource = rs. Does this statement work with VBA because DataSource does not show up as a property of an Access 2002 Image Control. So how do I point the Image Control to the table field which contains the BLOB in VBA code?

最后,如何将图像的字符串路径转换为二进制文件,以存储在VBA中的字节数组中.我具有VB 6.0的语法,该语法是..... .Fields("ImageBLOB").AppendChunk bytBLOB. VBA中代码的.Fields部分是否相关,以告知要写入哪个表字段,AppendChunk方法是否处理所有转换?

Finally, how do you convert the string path of the image to binary for storage in a byte Array in VBA. I have the syntax for a VB 6.0 which is..... .Fields("ImageBLOB").AppendChunk bytBLOB. Is the .Fields portion of the code relevant in VBA to tell what table field to write to and does the AppendChunk method handle all the conversion?

目前,我不确定我需要哪些对象库.我正在使用的代码与已安装的库之间似乎存在着巨大的冲突.我拥有的ADO库是2.5,我有Office和Access 10.0库,还有更多我不确定的库.无论是什么,当我的App碰到AppendChunk方法时,都会引发错误.

Concurrently I'm not sure what object libraries I need.  There seems to be massive conflicts between the code I'm using and my installed libraries.  The ADO library I have is 2.5 and I have Office and Access  10.0 libraries plus a bunch more that I am not sure of.  Whatever it is, my App is throwing errors when it hit the AppendChunk method.

Andrew,

Andrew,
   

推荐答案


看看以下内容是否有帮助:


See if the following helps:


这篇关于在SQL中使用VBA代码存储BLOB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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