将图片以二进制的形式写入数据库mdb出错
--------------------编程问答-------------------- --------------------编程问答-------------------- 你的问题应该是没有当前记录,或者记录没有打开另外
fl = LOF(1)
ReDim strb(f1)
这个错误,应该是:ReDim strb(f1-1)
--------------------编程问答-------------------- 前些天这个帖子顺便参考一下吧
http://bbs.csdn.net/topics/390546962
√ 将图片以二进制的形式写入数据库mdb出错 [推荐] [ 数据库(包含打印,安装,报表)] --------------------编程问答-------------------- http://download.csdn.net/detail/veron_04/1483930 --------------------编程问答-------------------- http://blog.csdn.net/vansoft/article/details/3667917 --------------------编程问答--------------------
Dim sTemp As String
sTemp = "insert into mypic(pic) values(?) "
dim PicB() as byte
dim FileID as long
fileid=freefile
open "c:/test.bmp" for binary access read as #fileid
redim picb(lof(fileid))
get fileid,,picb
close #fileid
dim Con as new connection
dim CMD as new command
con.connectionstring ="数据库连接字符串"
con.open
cmd.activeconnection=con
cmd.commandtext= stemp
cmd.commandtype=adcmdtext
cmd.parameters(0).type=adbinary
cmd.parameters(0).value=picb
cmd.execute
con.close
set cmd=nothing
set con=nothing
补充:VB , 数据库(包含打印,安装,报表)