Microsoft OLE DB Fejl håber der nogen hjælp
Jeg har en dvddb men får denne fejlMicrosoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY oprettet desc' at line 1
/inc_list.asp, line 83
og inc_list.asp ser således ud
<%
if cmd = "Genre" then
Navigate = "&cmd=Genre&ID=" & ID & ""
end if
if cmd = "Alfa" then
Navigate = "&cmd=Alfa&Letter=" & letter & ""
end if
if cmd = "Search" then
Navigate = "&cmd=Search&Keyword=" & Keyword & "&Type=" & strType & ""
end if
%>
<%
intPage = Request("count")
If isNumeric(intPage) = False Or intPage < 1 Then
intPage = 1
End If
Set rsListe = Server.CreateObject("ADODB.RecordSet")
%>
<%
if cmd = "Genre" then
if id = 0 then
strSQL = "SELECT * FROM Film where albumid = " & strAlbumID & " ORDER BY " & strSort & ""
else
strSQL = "SELECT * FROM Film INNER JOIN Film2Genre ON Film.ID=Film2Genre.filmID WHERE Film2Genre.genreID=" & ID & " and film.albumid = " & strAlbumID & " ORDER BY Film." & strSort & ""
end if
end if
%>
<%
if cmd = "Alfa" then
if strLetter = "0" then
str_alfa = "0123456789"
else
str_alfa = strLetter
end if
bo_start = true
do while len(str_alfa) > 0
if bo_start = true then
str_sql1 = " where left(Titel,1) = '" & left(str_alfa, 1) & "'"
bo_start = false
else
str_sql1 = str_sql1 & " or left(Titel,1) = '" & left(str_alfa, 1) & "'"
end if
str_alfa = right(str_alfa, len(str_alfa) - 1)
loop
strSQL = "SELECT * FROM Film " & str_sql1 & " and albumid = " & strAlbumID & " ORDER BY Titel"
end if
%>
<%
if cmd = "Search" then
strSQL = "SELECT * FROM Film WHERE albumid = " & strAlbumID & " and "
if strType = 1 then
strSQL = strSQL & " (titel LIKE '%" & Keyword & "%'"
strSQL = strSQL & " OR beskrivelse LIKE '%" & Keyword & "%'"
strSQL = strSQL & " OR instruktor LIKE '%" & Keyword & "%'"
strSQL = strSQL & " OR skuespillere LIKE '%" & Keyword & "%') order by " & strSort & ""
end if
if strType = 2 then
strSQL = strSQL & " (titel LIKE '%" & Keyword & "%') order by " & strSort & ""
end if
if strtype = 3 then
strSQL = strSQL & " (beskrivelse LIKE '%" & Keyword & "%') order by " & strSort & ""
end if
if strtype = 4 then
strSQL = strSQL & " (skuespillere LIKE '%" & Keyword & "%') order by " & strSort & ""
end if
end if
%>
<%
rsListe.CursorLocation = 3
rsListe.Open strsql, Conn, 1
%>
<a name="list"></a>
<br/>
<!-- darkblue table-->
<table cellpadding="0" cellspacing="0" class="smallbluedarktable">
<tr>
<td >
<table cellpadding="0" cellspacing="0" style="width:100%;">
<tr>
<td style="text-align:left;width:33%;">
Sorter efter:
<a class="whiteLinkBold" href="./?Page=Sort&Sorttype=1" <%if strsorttype = "1" then%>style="text-decoration:underline;"<%end if%>>Titel</a> |
<a class="whiteLinkBold" href="./?Page=Sort&Sorttype=2" <%if strsorttype = "2" then%>style="text-decoration:underline;"<%end if%>>Spilletid</a> |
<a class="whiteLinkBold" href="./?Page=Sort&Sorttype=3" <%if strsorttype = "3" then%>style="text-decoration:underline;"<%end if%>>Nyeste</a>
</td>
<td style="font-size:16px;font-weight:bold;width:33%;text-align:center;">
<%if cmd = "Genre" then if ID = "0" then response.write "Alle titler" else response.write hentgenre(ID) end if end if%>
<%if cmd = "Alfa" then if letter = "0" then response.write "Titler der starter med 0-9" else response.write "Titler der starter med " & strletter & "" end if end if%>
<%if cmd = "Search" then response.write "Søgning" end if%>
</td>
<td style="text-align:right;width:33%;">Antal pr. side:
<a href="./?Page=CountPage&Count=8" class="whiteLinkBold" <%if strCountpage = "8" then%>style="text-decoration:underline;"<%end if%>>8</a> |
<a href="./?Page=CountPage&Count=16" class="whiteLinkBold" <%if strCountpage = "16" then%>style="text-decoration:underline;"<%end if%>>16</a> |
<a href="./?Page=CountPage&Count=24" class="whiteLinkBold" <%if strCountpage = "24" then%>style="text-decoration:underline;"<%end if%>>24</a></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- darkblue table-->
<br/>
<table style="width: 100%" cellpadding="0" cellspacing="0" class="style1">
<tr>
<td style="width:30%;text-align:left;">
</td>
<td style="text-align:center;width:40%;">
<form method="post" action="search.asp">
<input type="text" style="width:200px;" name="keyword" value="<%=keyword%>" class="input" />
<input name="search" type="image" src="images/knap_soeg.gif" class="inputCheckbox" /><br/>
<input type="radio" id="type1" class="inputCheckbox" name="type" value="1" <%if strType = 1 or strType = "" then%>checked="checked"<%end if%> title="Titel, Beskrivelse, Skuespillere, Instruktør"/><label for="type1" title="Titel, Beskrivelse, Skuespillere, Instruktør"> Alt</label>
<input type="radio" id="type2" class="inputCheckbox" name="type" value="2" <%if strType = 2 then%>checked="checked"<%end if%>/><label for="type2"> Titel</label>
<input type="radio" id="type3" class="inputCheckbox" name="type" value="3" <%if strType = 3 then%>checked="checked"<%end if%>/><label for="type3"> Beskrivelse</label>
<input type="radio" id="type4" class="inputCheckbox" name="type" value="4" <%if strType = 4 then%>checked="checked"<%end if%>/><label for="type4"> Skuespiller</label>
</form>
</td>
<td style="width:30%;text-align:right;">
<table cellpadding="0" cellspacing="0" style="background-color:#1B9DC6;">
<tr>
<td><img src="images/icon_left.gif" alt="" /></td>
<td style="color:#FFFFFF;font-size:10px;">Visning </td>
<td <%if strShowtype= 1 then%>style="background-color:#54B6D4;"<%end if%>><a href="./?Page=Show&Showtype=1"><img src="images/icon_list1.gif" style="border:0px;" alt="Standard visning" /></a></td>
<td <%if strShowtype= 2 then%>style="background-color:#54B6D4;"<%end if%>><a href="./?Page=Show&Showtype=2"><img src="images/icon_images.gif" style="border:0px;" alt="Cover visning"/></a></td>
<td <%if strShowtype= 3 then%>style="background-color:#54B6D4;"<%end if%>><a href="./?Page=Show&Showtype=3"><img src="images/icon_list.gif" alt="Listevisning" style="border:0px;" /></a></td>
<td><img src="images/icon_right.gif" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- content -->
<%
if rsListe.EOF then
response.write "<br/><br/>Der er ingen film fundet under denne forespørgsel."
else
%>
<%if strShowtype= 1 then%>
<!--#include file="inc_list_1.asp" -->
<%end if %>
<%if strShowtype= 2 then%>
<!--#include file="inc_list_2.asp" -->
<%end if %>
<%if strShowtype= 3 then%>
<!--#include file="inc_list_3.asp" -->
<%end if %>
<!-- navigate-->
<table cellpadding="0" cellspacing="0" class="smallbluedarktable">
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="width:100%;">
<tr>
<td style="text-align:left;width:33%;"><% If Clng(intPage) > 1 Then%><a class="whiteLinkBold" href="default.asp?Page=<%=Page%><%=navigate%>&count=<%=intPage - 1%>#list">Forrige side</a><%else%> <%end if %></td>
<td style="width:33%;text-align:center;">Side <%=intPage%> af <%=intPageCount %></td>
<td style="text-align:right;width:33%;"><%If Clng(intPage) < Clng(intPageCount) Then%><a class="whiteLinkBold" href="default.asp?Page=<%=Page%><%=navigate%>&count=<%=intPage + 1%>#list">Næste side</a><%else%> <%end if %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- /navigate-->
<%end if %><!-- / content-->
Server oplysninger
Windows 2003
Mysql 4.1