Vad fasen är det som gör att det blir så här?
Jag har testat en massa men får fasen inte till det. Det blir samma resultat hela tiden, spelar ingen roll vad man söker på i sökfältet. Avståndet ökar eller minskar mellan varje sökning.
Källkod:
<%
IF len(""&Request.Form("mystring"))=0 THEN
%>
<SCRIPT>
history.back()
</SCRIPT>
<%
ELSE
END IF
%>
<DIV ALIGN="center">
<%
Dim Sql
SET conn=server.createobject("adodb.connection")
conn.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source="&server.mappath("databaser/record_arch_020721.mdb"))
Sql = "SELECT * FROM records"
IF Request.Form("TypeSearch") = "artist" THEN
Sql = Sql & " WHERE artist LIKE '%" & Request.Form("mystring") & "%'"
END IF
IF Request.Form("TypeSearch") = "title" THEN
Sql = Sql & " WHERE title LIKE '%" & Request.Form("mystring") & "%'"
END IF
IF Request.Form("TypeSearch") = "year" THEN
Sql = Sql & " WHERE myyear LIKE '%" & Request.Form("mystring") & "%'"
END IF
SET rs = Server.CreateObject("ADODB.Recordset")
rs.Open Sql, conn, 3
IF rs.BOF and rs.EOF THEN
%>
<TABLE WIDTH="600" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#43557C">
<TR>
<TD ALIGN="left"><FONT FACE="Verdana" SIZE="2"><B>No record found</B></FONT></TD>
</TR>
<TR>
<TD ALIGN="left"><FONT FACE="Verdana" SIZE="1">Please, check your spelling and try again.</TD>
</TR>
</TABLE>
<%
ELSE
IF NOT rs.BOF THEN
%>
<TABLE WIDTH="600" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#43557C">
<TR>
<TD WIDTH="230" HEIGHT="20" BGCOLOR="#62749D"><B>[artist]</B></TD>
<TD BGCOLOR="#62749D"><B>[title]</B> <I>(clickable)</I></TD>
<TD WIDTH="60" BGCOLOR="#62749D"><B>[format]</B></TD>
<TD WIDTH="85" BGCOLOR="#62749D"><B>[prod. year]</B></TD>
</TR>
<%
DO WHILE Not rs.EOF
%>
<TR>
<TD ALIGN="left"><FONT FACE="Verdana" SIZE="1"><%= rs("artist") %></FONT></TD>
<TD ALIGN="left"><FONT FACE="Verdana" SIZE="1"><A HREF="#" TITLE="view record info" onclick="javascript:openwin('poprec.asp?id=<%= rs("id") %>','poprec','420','500');return false"><B><%= rs("title") %></B></A></FONT></TD><BR>
<TD ALIGN="left"><FONT FACE="Verdana" SIZE="1"><%= rs("format") %></FONT></TD>
<TD ALIGN="center"><FONT FACE="Verdana" SIZE="1"><%= rs("myyear") %></FONT></TD>
</TR>
<%
rs.MoveNext
LOOP
%>
</TABLE></DIV>
<%
END IF
END IF
rs.Close
conn.Close
%>
------------------------
Commodore 64 -
http://www.hammarstrom.d2g.comEdited by - Commodore 64 on 03 August 2002 23:56:41