'讀取文件到內(nèi)容 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("保存文件內(nèi)容的字段") = iStm.Read .Update End With
'完成后關(guān)閉對象 iRe.Close iStm.Close End Sub
'從數(shù)據(jù)庫中讀取數(shù)據(jù),保存成文件 Sub s_ReadFile() Dim iStm As ADODB.Stream Dim iRe As ADODB.Recordset Dim iConc As String