关于获取SQL SERVER中图像的问题。
我原来打算用如下的程序来显示SQL SERVER的图像,第一次获取时不会有问题,但获取第二张图像时,程序执行到标示的第6 行即告诉我错误13:类型不匹配,为什么呢?
后来我只用PICTURE 绑定到数据控件上。 可是到底为什么第二次就不行了呢?
dim intDataFile as integer
dim lngFileSize as long
dim binPicture() as byte
1 intDataFile = 1
2 if len(dir("pictemp.bmp")) then kill "pictemp.bmp"
3 open "pictemp.bmp" for binary access write as intDataFile
4 lngFileSize = adodc1.recordset("EmpImage").actualsize
5 ReDim binPicture(lngFileSize)
6 binPicture() = adodc1.recordset("EmpImage").Getchunk(lngFileSize)
7 put intDataFile,,binpicture()
8 Close intDataFile
txtFileName.text = "pictemp.bmp"
picture1.picture =loadpicture(txtfilename.text)