甲状腺激素偏低:VB中如何给存储过程传递二进制数组

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/04 23:52:46
存储过程参数定义如下
@var_Pic image

VB中二进制数组如下
dim img as binary
ReDim img(FileLen(dlgSelPic.FileName))
Open dlgSelPic.FileName For Binary As #FileNo
Get #FileNo, , img
Close #FileNo

参数传递代码
cmd.Parameters.Append cmd.CreateParameter(, adBinary, adParamInput, , img)
'cmd为定义的一个COMMAND对象

可是在参数传递时出错了
请问一下像这种类型的参数应该如何传递?
贴问题的时候写错了一个东西

dim img as binary
改为
dim img() as byte

其他参数的传递并没有问题,只有在传二进制数组时出现此问题

是打开文件写入文件dim img as binary
ReDim img(FileLen(dlgSelPic.FileName))
Open dlgSelPic.FileName For Binary As #FileNo
Get #FileNo, , img
就是要在vb程序中对存储过程的参数变量进行初始化
cmd.Parameters.Append cmd.CreateParameter(, adBinary, adParamInput, , img)

似乎应该在参数上指出类型(, adBinary as byte, adParamInput as ... , , img as ...)