当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 自己做,难度太大。主要是思路不正确。 想找一套写好的,体会体会,可是一直没找到。 asp的到处都是,php的找不到。 谢谢各位帮忙! ......
    摘要: 为什么邮件地址只能是本地的,而没有服务器的公用通讯录 是不是和服务器中的这个有关: 2003-04-16 08:55:04 router: unable to obtain internet host and domain names 这个问题怎么解决?? ......


如何压缩数据库

请高手解答

NO.1   作者: qieyj

While   working   on   BuildDB/Buildapp   online   Demo,   I   developed   a   little   function   that   will   compact   Access   databases   over   the   web.   Heres   a   "no-frills"   page   thatll   compact   the   databases   for   you.    
            One   problem   with   Access   databases   is   that   "holes"   are   created   when   records   are   deleted,   making   the   database   fluffy   and   bloated.   Compacting   the   database   makes   it   lean   and   efficient   again.  
             
            Note:   This   function/page   can   easily   be   combined   with   the   Buildapp   front   end   file   navigation   and   search   pages   (Installment   II),   to   create   an   application   thatll   make   it   easy   to   handle   this   formerly   troublesome   chore   for   all   the   databases   on   your   machine/web   site..    
             
             
             
            ++++++++++++   Begin   Compact.asp   +++++++++++++++++++++++++++++  
            <%  
            option   explicit  
            Const   JET_3X   =   4  
             
            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")  
             
            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  
            fso.CopyFile   strDBPath   &   "temp.mdb",dbpath  
            fso.DeleteFile(strDBPath   &   "temp.mdb")  
            Set   fso   =   nothing  
            Set   Engine   =   nothing  
            CompactDB   =   "Your   database,   "   &   dbpath   &   ",   has   been   Compacted"   &   vbCrLf  
            Else  
            CompactDB   =   "The   database   name   or   path   has   not   been   found.   Try   Again"   &   vbCrLf  
            End   If  
             
            End   Function  
            %>  
            <html><head><title>Compact   Database</title></head><body>  
             
            <h2   align="center">   Compacting   an   Access   database</h2>  
            <p   align="center">  
            <form   action=compact.asp>  
            Enter   relative   path   to   the   database,   including   database   name.<br><br>  
            <input   type="text"   name="dbpath"><br><br>  
            <input   type="checkbox"   name="boolIs97"   value="True">   Check   if   Access   97   database  
            <br><i>   (default   is   Access   2000)</i><br><br>  
            <input   type="submit">  
            <form>  
            <br><br>  
            <%  
            Dim   dbpath,boolIs97  
            dbpath   =   request("dbpath")  
            boolIs97   =   request("boolIs97")  
             
            If   dbpath   <>   ""   Then  
            dbpath   =   server.mappath(dbpath)  
            response.write(CompactDB(dbpath,boolIs97))  
            End   If  
            %>  
            </p></body></html>  
             
            ++++++++++++   End   Code    
 


    摘要: 现在我作的程序由于接口只提供视图,因此从oracle视图当中取数据,此视图有1600多万条记录,由前台发出select count(1) from view_dlfx where jh=23 查询语句,需要20分钟左右。而当select count(1) from view_dlfx where jh=23 or jh=24 or jh=25 or jh=26 查询语句,需要60分钟左右.......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE