PDA

View Full Version : Top 5 + databas


Lazerzubb
2001-01-21, 10:16
Så här ser koden ut i asp
//
<!-- #include virtual="/land/adovbs.stm" -->
<% Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=D:/inetpub/wwwroot/sok1.mdb"

SQL = "SELECT TOP 5 * FROM sok ORDER BY ID DESC"
set rs=Connect.Execute(SQL)
if not rs.eof then
do until rs.eof
%>
<%=rs("LAND")%><br>
<%rs.movenext
loop
%><%
end if

rs.close
set rs=Nothing
Connect.close
set connect=nothing

%>
//
jag vill få den i wml.


------------------
Lazerzubb

AG
2001-01-25, 22:09
Nåt i den här stilen borde fungera utmärkt:

<%
Response.ContentType="image/vnd.wap.wbmp"
%>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="main" title="wap">
<p>
<!-- #include virtual="/land/adovbs.stm" -->
<% Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=D:/inetpub/wwwroot/sok1.mdb"
SQL = "SELECT TOP 5 * FROM sok ORDER BY ID DESC"
set rs=Connect.Execute(SQL)
if not rs.eof then
do until rs.eof
%>

<%=rs("LAND")%><br/>
<%
rs.movenext
loop
end if
%>
</p>
<%
rs.close
set rs=nothing
connect.close
set connect=nothing
%>

</card>
</wml>


Andreas


[Redigerat av AG den 25 jan 2001]