Hej mini-me
Næh du der skal meget mere til ;)
Sorry for den tid det har taget men har desværre ikke rigtig haft tid. Jeg regner med at du selv kan lave connection til database.
Her har du koden der skal til.
------------------- Klip for kode ----------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/ekspertenConn.asp" -->
<%
vaget = 2
str = 0
pris = 105
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = Driver={SQL Server};Server=.\SQLEXPRESS;Database=eksperten;UID=brugernavn;PWD=kodeord
Recordset1_cmd.CommandText = "SELECT id, pris, vaegt, str, leveringspris FROM dbo.tblForsendelse WHERE ((vaegt <= '" & vaegt & "') AND (str = '" & str & "')) OR (pris <= '" & pris & "') ORDER BY leveringspris DESC;"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Prisen vil altid være den første record
<table border="1">
<tr>
<td>id</td>
<td>pris</td>
<td>vaegt</td>
<td>str</td>
<td>leveringspris</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<tr>
<td><%=(Recordset1.Fields.Item("id").Value)%></td>
<td><%=(Recordset1.Fields.Item("pris").Value)%></td>
<td><%=(Recordset1.Fields.Item("vaegt").Value)%></td>
<td><%=(Recordset1.Fields.Item("str").Value)%></td>
<td><%=(Recordset1.Fields.Item("leveringspris").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<%
'Hvis du ikke vælger den første metode kan du løbe records igennem
Recordset1.moveFirst
while CDbl(Recordset1.Fields.Item("leveringspris").Value) <= CDbl(leveringspris) or Recordset1.EOF
Recordset1.movenext
wend
if Recordset1.EOF then
forsendelsenKoster = 0
else
forsendelsenKoster = Recordset1.Fields.Item("leveringspris").Value
end if
response.write("Forsendelsen koster: DKK. " & formatNumber(forsendelsenKoster,2))
%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>