Er der nogen der kan fortælle hvorfor jeg får følgende fejlmeddelse, når jeg
bruger nedenstående script:
(problemet opstår når der er adgangskode på databasen)
Microsoft JET Database Engine fejl '80040e4d'
Cannot start your application. The workgroup information file is missing or
opened exclusively by another user.
/db/compact_database.asp, linje 42
<%
sSource = Server.Mappath("db1.mdb")
sDestination = Server.Mappath("db2.mdb")
sUser = "Admin"
sPassword = "1234"
sSecurity = ""
Set oJet = CreateObject("JRO.JetEngine")
' Put together the provider string for the source database
sCompactPart1 = "Provider=Microsoft.Jet.OLEDB.4.0" & _
";Data Source=" & sSource & _
";User Id=" & sUser & _
";Password=" & sPassword
' If the database has a user-level security file, add the
' details
If sSecurity <> "" Then
sCompactPart1 = sCompactPart1 & _
";Jet OLEDB:System database=" & sSecurity & ";"
End If
' Put together the provider string for the destination
' database
sCompactPart2 = "Provider=Microsoft.Jet.OLEDB.4.0" & _
";Data Source=" & sDestination
' The destination database will end up in the latest version
' of jet, unless a specific version has been requested;
' 1 = Jet 1.0, 2 = Jet 1.1, 3 = Jet 2.x, 4 = Jet 3.x,
' 5 = Jet 4.x etc
If lDestinationVersion <> 0 Then
sCompactPart2 = sCompactPart2 & _
";Jet OLEDB:Engine Type=" & lDestinationVersion
End If
' Compact and repair the database
'Set oJet = New JRO.JetEngine
oJet.CompactDatabase sCompactPart1, sCompactPart2
Set oJet = Nothing
CompactAndRepairDB = True
%>
Mvh. Christoffer Thygesen
homepage:
http://cht.dk
e-mail: cht@cht.dk