'寫圖檔
Sub Blob2File(BlobX,strFileName)
Set objStream = CreateObject("ADODB.Stream")
objStream.open
objStream.Type = 1
objStream.Write BlobX
objStream.SaveToFile strFileName,2
Set objStream = Nothing
End Sub
'寫文字檔
Sub SaveToFile(ByVal strBody,ByVal File)
Dim objStream
On Error Resume Next
Set objStream = CreateObject("ADODB.Stream")
If Err.Number=-2147221005 Then
msgbox "您的主机不支持ADODB.Stream,不能使用本程序"
Err.Clear
End If
With objStream
.Type = 2
.Open
.Charset = "UTF-8"
.Position = objStream.Size
.WriteText = strBody
.SaveToFile File,2
.Close
End With
Set objStream = Nothing
End Sub
沒有留言:
張貼留言