'读取文件到内容 Set iStm = New ADODB.Stream With iStm .Type = adTypeBinary '二进制模式 .Open .LoadFromFile "c:\test.doc" End With
'打开保存文件的表 Set iRe = New ADODB.Recordset With iRe .Open "表", iConc, adOpenKeyset, adLockOptimistic .AddNew '新增一条记录 .Fields("保存文件内容的字段") = iStm.Read .Update End With
'完成后关闭对象 iRe.Close iStm.Close End Sub
'从数据库中读取数据,保存成文件 Sub s_ReadFile() Dim iStm As ADODB.Stream Dim iRe As ADODB.Recordset Dim iConc As String