六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

壓縮并修好Access數據庫(推薦)

[摘要]Compact and Repair You can use the "Compact and Repair" function in Access from ASP code. The following code is an example of how this can ...

Compact and Repair


You can use the "Compact and Repair" function in Access from ASP code. The following code is an example of
how this can be done. Note that when you decide to "Compact and Repair" your Access database, some
autonumbers can be changed. Access makes all autonumbers consecutive.
This code uses one database, but I'm sure the code can easily be changed so that the listbox displays, for
example, all the databases in one folder.


<%

Const Jet_Conn_Partial = "Provider=Microsoft.Jet.OLEDB.4.0; Data source="
Dim strDatabase, strFolder, strFileName

'#################################################
'# Edit the following two lines
'# Define the full path to where your database is
strFolder = "F:\InetPub\wwwroot\_db\"
'# Enter the name of the database
strDatabase = "YourAccessDatabase.mdb"
'# Stop editing here
'##################################################

Private Sub dbCompact(strDBFileName)
Dim SourceConn
Dim DestConn
Dim oJetEngine
Dim oFSO

SourceConn = Jet_Conn_Partial & strFolder & strDatabase
DestConn = Jet_Conn_Partial & strFolder & "Temp" & strDatabase

Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oJetEngine = Server.CreateObject("JRO.JetEngine")

With oFSO

If Not .FileExists(strFolder & strDatabase) Then
Response.Write ("Not Found: " & strFolder & strDatabase)
Stop
Else
If .FileExists(strFolder & "Temp" & strDatabase) Then
Response.Write ("Something went wrong last time " _
& "Deleting old database... Please try again")
.DeleteFile (strFolder & "Temp" & strDatabase)
End If
End If
End With

With oJetEngine
.CompactDatabase SourceConn, DestConn
End With

oFSO.DeleteFile strFolder & strDatabase
oFSO.MoveFile strFolder & "Temp" _
& strDatabase, strFolder& strDatabase

Set oFSO = Nothing
Set oJetEngine = Nothing
End Sub

Private Sub dbList()
Dim oFolders
Set oFolders = Server.CreateObject("Scripting.FileSystemObject")
Response.Write ("<Select Name=""DBFileName"">")
For Each Item In oFolders.GetFolder(strFolder).Files
If LCase(Right(Item, 4)) = ".mdb" Then
Response.Write ("<Option Value=""" & Replace(Item, strFolder, "") _
& """>" & Replace(Item, strFolder, "") & "</Option>")
End If
Next
Response.Write ("</Select>")

Set oFolders = Nothing
End Sub


%>
<%
' Compact database and tell the user the database is optimized
Select Case Request.form("cmd")
Case "Compact"
dbCompact Request.form("DBFileName")
Response.Write ("Database " & Request.form("DBFileName") & " is optimized.")
End Select
%>

<p><font size="4">Compact and repair database</font></p>
<form method="POST" action="">
<p><%dbList%><input type="submit" value="Compact" name="cmd"></p>
</form>



主站蜘蛛池模板: 五月婷婷综合在线 | 有码中文字幕在线观看 | 特黄一级视频 | 亚洲欧美中日韩中文字幕 | 色狠狠狠色噜噜噜综合网 | 天天综合网天天综合色不卡 | 日本三级成人午夜视频网 | 日韩一级欧美一级一级国产 | 亚洲欧美伦理 | 日韩精品免费一线在线观看 | 色姣姣狠狠撩综合网 | 天天躁夜夜躁狠狠躁2021西西 | 日本免费观看日本高清视频 | 色综合天天射 | 日韩视频在线观看免费 | 一个色综合网站 | 四虎影视国产884a精品亚洲 | 日韩一级片在线播放 | 一区二区在线视频观看 | 日韩在线视频免费播放 | 亚洲图区综合网 | 午夜视频免费在线播放 | 综合 欧美 亚洲日本 | 人人揉揉揉人人捏人人看 | 日韩成人av在线 | 五月婷婷在线播放 | 午夜免费视频观看在线播放 | 青娱乐最新官网 | 色综合色综合 | 欧美性生交xxxxx久久久 | 青草视频免费观看在线观看 | 四虎影永久在线观看精品 | 五月综合激情久久婷婷 | 午夜欧美性欧美 | 揄拍成人国产精品视频 | 天堂中文资源在线地址 | 午夜欧美福利 | 奇米婷婷 | 日本天堂视频 | 青青青久草 | 网站在线观看高清免费 |