Hittade felet, det uppstår när en besökare kommer till sidan direkt till en submapp, då blir sökvägen fel :)
Frågan#1
En kund får följande fel:
Microsoft JET Database Engine error '80004005'
'e:\www\admin\userXXX\html\data\forum.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/LM/W3SVC/408/ROOT/global.asa, line 21
på följande kod:
<script language=VBScript runat=Server>
Sub Session_OnStart
Session.TimeOut = 30
'Session("Sys.HideText") = "True"
If Request.ServerVariables("HTTP_HOST") = "no.xxxxxxx.se" Then
Session.LCID = 1044 ' Norge
Session("Locale.ID") = "no"
ElseIf Request.ServerVariables("HTTP_HOST") = "eu.xxxxxxx.se" Then
Session.LCID = 1033 ' England (EU)
Session("Locale.ID") = "eu"
Else
Session.LCID = 1053 ' Sverige
Session("Locale.ID") = "se"
End If
'On Error Resume Next
' Initiera databaskoppling
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open Application("forum_db")
' Skapa ett uppslagsverk med alla texter
Set TextRecordset = Connection.Execute("SELECT * FROM site_texts")
Set Session("Sys.Text") = CreateObject("Scripting.Dictionary")
Dim TempText
Dim PresentText
Do Until TextRecordset.EOF = True
TempText = TextRecordset("c" & Session.LCID)
If IsNull(TempText) Or Len(TempText) < 1 Then
PresentText = "" & TextRecordset("c" & Application("DefaultLCID"))
Else
PresentText = TempText
End if
If Session("Sys.HideText") = "True" Then PresentText = "50"
Session("Sys.Text").Add TextRecordset("Theme") & "_" & _
TextRecordset("Type") & "_" & _
TextRecordset("Name"), PresentText
TextRecordset.MoveNext
Loop
Set TempText = Nothing
Set PresentText = Nothing
TextRecordset.Close
' Skapa ett uppslagsverk med alla telefoner
Dim ManRecordset
Dim PhonesRecordset
Set Session("Phones.Phones") = CreateObject("Scripting.Dictionary")
Set ManRecordset = Connection.Execute("SELECT ID, Namn FROM phones_manufacturers")
Do Until ManRecordset.EOF = True
Set PhonesRecordset = Connection.Execute("SELECT Modell, ID FROM phones_phones WHERE (Tillverkare = " & ManRecordset("ID") & ")")
Do Until PhonesRecordset.EOF = True
Session("Phones.Phones").Add UCase(ManRecordset("Namn") & " " & PhonesRecordset("Modell")), "id" & PhonesRecordset("ID")
PhonesRecordset.MoveNext
Loop
PhonesRecordset.Close
ManRecordset.MoveNext
Loop
ManRecordset.Close
' Stäng allt
Connection.Close
Set ManRecordset = Nothing
Set PhonesRecordset = Nothing
Set TextRecordset = Nothing
Set Connection = Nothing
End Sub
Sub Session_OnEnd
Set Session("Sys.Text") = Nothing
Set Session("Phones.Phones") = Nothing
End Sub
Sub Application_OnStart
Application("DefaultLCID") = 1053
Application("Sys.Version") = "4.0"
Application("Sys.Copyright") = "<b>Secure Computing</b> 1999 - " & Year(Date)
Application("mobilforum_db") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../data/forum.mdb")
End Sub
Sub Application_OnEnd
Set Application("DefaultLCID") = Nothing
Set Application("Sys.Version") = Nothing
Set Application("Sys.Copyright") = Nothing
Set Application("forum_db") = Nothing
End Sub
</script>
om han sen laddar upp Global.asa på nytt när felet uppstår så fungerar allt som det ska!?
Vad kan vara fel?
Rad 21: Connection.Open Application("forum_db")