Kender ikke database
Hvad går galt her??Microsoft OLE DB Provider for ODBC Drivers error ''80004005''
[Microsoft][ODBC Microsoft Access 97 Driver] Can''t open database ''(unknown)''. It may not be a database that your application recognizes, or the file may be corrupt.
/kim/asp/video/video.asp, line 30
Koden er:
<% Response.Buffer = True %>
<html><head>
<title>Søgeresultat</title>
</head><body>
<%
strKeyword = Trim(Request.Form("Keyword"))
If Len(strKeyword) = 0 Then
Response.Clear
Response.Redirect("search.htm")
Else
strKeyword = Replace(strKeyword,"''","''''")
End If
strSQL = "SELECT FilmID, Titel, Bandnr, ProdAar, Genre, Spilletid FROM video WHERE"
strSQL = strSQL & " (Titel LIKE ''%" & strKeyword & "%'')"
strSQL = strSQL & " OR (Bandnr LIKE ''%" & strKeyword & "%'')"
strSQL = strSQL & " OR (ProdAar LIKE ''%" & strKeyword & "%'')"
strSQL = strSQL & " OR (Genre LIKE ''%" & strKeyword & "%'')"
strSQL = strSQL & " OR (Spilletid LIKE ''%" & strKeyword & "%'')"
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("video.mdb")
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open strDSN
Set rs = myConn.Execute(strSQL)
If Not (rs.BOF Or rs.EOF) Then
Response.Write "<p>Søgeresultat</p>"
Response.Write "<table border=1>"
Response.Write "<tr><th>Titel</th><th>Bandnr</th><th>ProdAar</th><th>Genre</th><th>Spilletid</th></tr>"
Do While Not rs.EOF
Response.Write "<tr><td>" & rs("Titel") & "</td>"
Response.Write "<td>" & rs("Bandnr") & "</td>"
Response.Write "<td>" & rs("ProdAar") & "</td>"
Response.Write "<td>" & rs("Genre") & "</td>"
Response.Write "<td>" & rs("Spilletid") & "</td></tr>"
rs.MoveNext
Loop
Response.Write "</table>"
Else
Response.Write "<p>Der er ikke fundet noget på denne søgning</p>"
End If
myConn.Close
Set myConn = Nothing
%>
</body></html>
Linie 30: myConn.Open strDSN