|
高手们帮我看看,最近好象都不见 HG了!
Dim RST As New ADODB.Recordset, CNN As New ADODB.Connection
Dim strFilter As String
Dim strInputFileName As String
strFilter = ahtAddFilterItem(strFilter, "所有图像格式 (*.Jpg,*.Jpeg,*.Bmp,*.Gif)", "*.Jpg;*.Jpeg;*.Bmp;*.Gif")
strFilter = ahtAddFilterItem(strFilter, "所有格式 (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave(Filter:=strFilter, OpenFile:=True, _
DialogTitle:="lease select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
图片文件名 = GetFileName(strInputFileName) & "." & GetFileExt(strInputFileName) '读取图象文件名
If strInputFileName = "" Then Exit Sub
请教如何将以下代码用一个存储过程增加记录(二进制字段)
Set CNN = CurrentProject.Connection
RST.Open "Tb_背景图库 ", CNN, adOpenStatic, adLockPessimistic
FileSize = FileLen(strInputFileName)
ReDim FileData(FileSize) '重新初始化数组
FileNo = FreeFile '获取一个空闲的文件号
Open strInputFileName For Binary As #FileNo '打开文件
Get #FileNo, , FileData() '读取文件内容到数组
Close #FileNo '关闭文件
RST.AddNew
RST!说明 = 图片文件名
RST!背景图 = FileData() '保存数据
RST.Update '更新数据
Erase FileData '释放内存
RST.Close
Set RST = Nothing
|
|