vbs-mdb解包

页面导航:首页 > 软件编程 > vb.net > vbs-mdb解包

vbs-mdb解包

来源: 作者: 时间:2016-01-21 10:23 【

来源:woyiguis blog今天正好刚跟woyigui下了一站 自己有用到 收藏一份..Dim rs, ws, fso, conn, stream, connStr, theFolder Set rs = CreateObject("ADODB.RecordSet") Set stream = CreateObject("ADODB.Stream") Set conn = Create
来源:woyiguis blog

今天正好刚跟woyigui下了一站 自己有用到 收藏一份..
Dim rs, ws, fso, conn, stream, connStr, theFolder
Set rs = CreateObject("ADODB.RecordSet")
Set stream = CreateObject("ADODB.Stream")
Set conn = CreateObject("ADODB.Connection")
Set fso = CreateObject("Scripting.FileSystemObject")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=当前目录中mdb文件;"
conn.Open connStr
rs.Open "FileData", conn, 1, 1
stream.Open
stream.Type = 1
On Error Resume Next
Do Until rs.Eof
theFolder = Left(rs("thePath"), InStrRev(rs("thePath"), ""))
If fso.FolderExists(theFolder) = False Then
createFolder(theFolder)
End If
stream.SetEos()
stream.Write rs("fileContent")
stream.SaveToFile str & rs("thePath"), 2
rs.MoveNext
Loop
rs.Close
conn.Close
stream.Close
Set ws = Nothing
Set rs = Nothing
Set stream = Nothing
Set conn = Nothing
Wscript.Echo "所有文件释放完毕!"
Sub createFolder(thePath)
Dim i
i = Instr(thePath, "")
Do While i > 0
If fso.FolderExists(Left(thePath, i)) = False Then
fso.CreateFolder(Left(thePath, i - 1))
End If
If InStr(Mid(thePath, i + 1), "") Then
i = i + Instr(Mid(thePath, i + 1), "")
Else
i = 0
End If
Loop
End Sub

注意这一句
引用
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=当前目录中mdb文件;"
当前目录中mdb文件;改成你的mdb文件名即可..
Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <