婷婷久久综合九色综合,欧美成色婷婷在线观看视频,偷窥视频一区,欧美日本一道道一区二区

<tt id="bu9ss"></tt>
  • <span id="bu9ss"></span>
  • <pre id="bu9ss"><tt id="bu9ss"></tt></pre>
    <label id="bu9ss"></label>

    當(dāng)前位置:首頁 >  站長 >  編程技術(shù) >  正文

    深入淺析ASP在線壓縮access數(shù)據(jù)庫的方法

     2020-10-29 11:41  來源: 腳本之家   我來投稿 撤稿糾錯

      阿里云優(yōu)惠券 先領(lǐng)券再下單

    這篇文章主要介紹了ASP在線壓縮access數(shù)據(jù)庫的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

    ASP在線壓縮ACCESS數(shù)據(jù)庫原理很簡單:利用JRO.JetEngine的壓縮功能建立一個新的數(shù)據(jù)庫文件,然后把原來的刪掉、替換!既然這樣,壓縮程序只需幾行就ok了!

    把下面的代碼保存為**.asp,數(shù)據(jù)庫文件(db.md)放在相同目錄下,執(zhí)行asp搞定!

    <%
    oldDB = server.mappath("db.mdb") '更改數(shù)據(jù)庫地址
    newDB = server.mappath("db_new.mdb") '生成臨時文件
    Set FSO = Server.CreateObject("Scripting.FileSystemObject")
    Set Engine = Server.CreateObject("JRO.JetEngine")
    prov = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    Engine.CompactDatabase prov & OldDB, prov & newDB
    set Engine = nothing
    FSO.DeleteFile oldDB '刪除臨時文件
    FSO.MoveFile newDB, oldDB
    set FSO = Nothing
    response.write "OK"
    %>

    下面是一個ASP在線壓縮ACCESS數(shù)據(jù)庫的封裝函數(shù)

    Function CompactDB(dbPath, boolIs97)
    Dim fso, Engine, strDBPath
    strDBPath = left(dbPath,instrrev(DBPath,"\"))
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FileExists(dbPath) Then
    Set Engine = CreateObject("JRO.JetEngine")
    On Error Resume Next
    If boolIs97 = "True" Then
    Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb;" _
    & "Jet OLEDB:Engine Type=" & JET_3X
    Else
    Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbpath, _
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb"
    End If
     
    If Err Then
    response.write "<script LANGUAGE='javascript'>alert('無法識別數(shù)據(jù)庫類型.');history.go(-1);</script>"
    response.end
    end if
    fso.CopyFile strDBPath & "temp.mdb",dbpath
    fso.DeleteFile(strDBPath & "temp.mdb")
    Set fso = nothing
    Set Engine = nothing
    CompactDB = "<script>alert('壓縮成功!');javascript:history.go(-1);</script>"
    Else
    CompactDB = "<script>alert('找不到數(shù)據(jù)庫!\n請檢查數(shù)據(jù)庫路徑是否輸入錯誤!');history.back();</script>"
    End If
    End Function

    總結(jié)

    到此這篇關(guān)于ASP在線壓縮access數(shù)據(jù)庫的方法的文章就介紹到這了,更多相關(guān)ASP在線壓縮access數(shù)據(jù)庫內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

    來源:腳本之家

    鏈接:https://www.jb51.net/article/195613.htm

    申請創(chuàng)業(yè)報道,分享創(chuàng)業(yè)好點子。點擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!

    相關(guān)文章

    熱門排行

    信息推薦