<%
vad = Request.form("vad")
sok = Request.form("sok")
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open("server=servernamn;driver={SQL Server};uid=sa;pwd=;database=Quedata")
Set RS = Server.CreateObject("ADODB.Recordset")
If (vad = "0") then
SQLFRAGA = "SELECT IDnr, Artist, Lat, Ripper, Format FROM MusicVideos WHERE Artist LIKE'%" & sok & "%' OR Ripper LIKE'%" & sok & "%' OR Format LIKE'%" & sok & "%' OR Lat LIKE'%" & sok & "%' ORDER BY Artist ASC"
RS.open SQLFRAGA,Connection,3,1,1
IDnr = RS("Idnr")
Artist = RS("Artist")
Lat = RS("Lat")
Ripper = RS("Ripper")
Format = RS("Format")
else
SQLFRAGA = "SELECT IDnr, Artist FROM MusicVideos WHERE Artist LIKE'%" & sok & "%' ORDER BY Artist ASC"
RS.open SQLFRAGA,Connection,3,1,1
IDnr = RS("Idnr")
Artist = RS("Artist")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>MusicVideos Search 0.1 Beta 4 & utveckling</title>
</head>
<body>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" class="normal" bgcolor="#6A8B60"><font color="#FFFFFF">Du
sökte på <b><%=sok%></b> och fick <b><%=RS.RecordCount%></b>
träffar</font></td>
</tr>
<tr>
<td width="100%" class="normal"> </td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<%
If RS.RecordCount = 0 or RS.RecordCount = null Then
Response.Write "Hittade inga!!"
Else
Do While not RS.EOF
If (vad = "0") then %>
<tr>
<td width="7%" class="normal" valign="top"><a
href="view.asp?ID=<%=ID%>"><img border="0" src="images/result_art.gif" WIDTH="16" HEIGHT="16"></a></td>
<td width="93%" class="normal"><b><a
href="view.asp?ID=<%=ID%>"><%=Artist%></a></b><br>
<%=Lat%><br><br></td>
</tr>
<%ELSE%>
<tr>
<td width="7%" class="normal" valign="top"><a href="router.asp?lank=<%=ID%>"
target="_new"><img border="0" src="images/result_lank.gif" ALT="<%=url%>"
WIDTH="16" HEIGHT="16"></a></td>
<td width="93%" class="normal"><b><a href="router.asp?lank=<%=ID%>"
target="_new"><%=Artist%></a></b><br>
<%=lat%><br><br></td>
</tr>
<%
END IF
RS.MoveNext
Loop
END IF
RS.Close
set RS = nothing
Connection.close
set connection = nothing
%>
</table>
</body>
</html>
--------------
när man kör aspn däremot o söker på en "Ripper" som har gjort flera låtar så skriver den ut rätt antal som han gjort men den skriver bara ut den artist som står längst upp i databasen... nån som vet hur man får ordning på detta?