Djkalavera
MIS
Ok I tried some paging scripts around but they donesn´t worked, so here´s my recordset script, Can someone help me to divide the results in pages?
ok Here it is:
<%Option Explicit%>
<!--#INCLUDE FILE="format.inc"-->
<%
dim Conn, RS, ID
Set Conn = GetConnection
Response.Buffer=True
if "" & Request.QueryString("ID" <> "" and isnumeric(Request.QueryString("ID") then
'If there is an ID in QUERY_STRING
'Write file from db to the client
ID = Clng(Request.QueryString("ID")
if ucase(Request.QueryString("A")="D" then'Delete
Conn.execute("delete from Upload where UploadID=" & ID)
Else'Download
'file record
Set RS = Conn.execute("select * from Upload where UploadID=" & ID)
if ucase(Request.QueryString("A")<>"P" then
response.contenttype = RS("ContentType"'set Content-Type
Response.AddHeader "Content-Disposition", "attachment;filename=""" & RS("SouceFileName" & """"
End If
' Response.BinaryWrite RS("Data".Value 'Write the file from db field to the client
Response.BinaryWrite RS("Data".GetChunk(RS("DataSize") 'Write the file from db field to the client
RS.Close
Conn.Close
Response.End
End If'Download
End If
response.write Head("7-Replays", "Replay Database"
response.write DBList(Conn)
Conn.Close
function DBList(Conn)
dim HTML, RS, ContentType
'Open recordset with the files
Set RS = Conn.execute("select UploadID, SouceFileName, Ganador, Razag, Perdedor, Razap, Mapa, ContentType from Upload order by UploadDT desc"
HTML = HTML & "<Table><tr><th ColSpan=3><font face=Arial color=silver size=3>Replays : </font></th></tr>" & vbcrlf
HTML = HTML & "<Table><tr><th ColSpan=2><font face=Arial color=silver size=1>Sube tus Replays <a href= & vbcrlf
HTML = HTML & "<tr><th bgcolor=gray><strong><font face=Arial color=silver size=2>D/l</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Ganador</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Perdedor</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Mapa</font></strong></th></tr>" & vbcrlf
do while not RS.Eof
ContentType = lcase("" & RS("ContentType")
HTML = HTML & "<tr><td> <A HREF=" & Request.ServerVariables("SCRIPT_NAME" & "?ID=" & RS("UploadID"
if left(ContentType,6)="image/" or left(ContentType,5)="text/" then
HTML = HTML & " onmouseover=""ShowFile('" & RS("UploadID" & "')"" onmouseout=""HideFile()"""
end if
HTML = HTML & "><img border=0 src=dl.gif>" & "</A>"
HTML = HTML & " </td><td><strong><font face=Arial size=2>" & RS("Ganador" & "</font></strong><font size=1 color=gray>" & RS("Razag" & "</font></td><td><strong><font face=Arial size=2>" & RS("Perdedor" & "</font></strong><font size=1 color=gray>" & RS("Razap" & "</font>"
HTML = HTML & " </td><td><font face=Arial size=2>" & RS("Mapa" & "</font></td></tr>" & vbcrlf
RS.MoveNext
loop
HTML = HTML & "</Table>" & vbcrlf
DBList = HTML
RS.Close
end function
function GetConnection()
dim Conn, AuthConnectionString
' AuthConnectionString = "DBQ=" & Server.MapPath("upload.mdb" & ";DefaultDir=" & Server.MapPath("/" & ";" & _
' "Driver={Microsoft Access Driver (*.mdb)}; DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5;UID=;"
AuthConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("upload.mdb"
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.open AuthConnectionString
set GetConnection = Conn
end function
%>
</Script>
ok Here it is:
<%Option Explicit%>
<!--#INCLUDE FILE="format.inc"-->
<%
dim Conn, RS, ID
Set Conn = GetConnection
Response.Buffer=True
if "" & Request.QueryString("ID" <> "" and isnumeric(Request.QueryString("ID") then
'If there is an ID in QUERY_STRING
'Write file from db to the client
ID = Clng(Request.QueryString("ID")
if ucase(Request.QueryString("A")="D" then'Delete
Conn.execute("delete from Upload where UploadID=" & ID)
Else'Download
'file record
Set RS = Conn.execute("select * from Upload where UploadID=" & ID)
if ucase(Request.QueryString("A")<>"P" then
response.contenttype = RS("ContentType"'set Content-Type
Response.AddHeader "Content-Disposition", "attachment;filename=""" & RS("SouceFileName" & """"
End If
' Response.BinaryWrite RS("Data".Value 'Write the file from db field to the client
Response.BinaryWrite RS("Data".GetChunk(RS("DataSize") 'Write the file from db field to the client
RS.Close
Conn.Close
Response.End
End If'Download
End If
response.write Head("7-Replays", "Replay Database"
response.write DBList(Conn)
Conn.Close
function DBList(Conn)
dim HTML, RS, ContentType
'Open recordset with the files
Set RS = Conn.execute("select UploadID, SouceFileName, Ganador, Razag, Perdedor, Razap, Mapa, ContentType from Upload order by UploadDT desc"
HTML = HTML & "<Table><tr><th ColSpan=3><font face=Arial color=silver size=3>Replays : </font></th></tr>" & vbcrlf
HTML = HTML & "<Table><tr><th ColSpan=2><font face=Arial color=silver size=1>Sube tus Replays <a href= & vbcrlf
HTML = HTML & "<tr><th bgcolor=gray><strong><font face=Arial color=silver size=2>D/l</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Ganador</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Perdedor</font></strong></th><th bgcolor=gray><strong><font face=Arial color=silver size=2>Mapa</font></strong></th></tr>" & vbcrlf
do while not RS.Eof
ContentType = lcase("" & RS("ContentType")
HTML = HTML & "<tr><td> <A HREF=" & Request.ServerVariables("SCRIPT_NAME" & "?ID=" & RS("UploadID"
if left(ContentType,6)="image/" or left(ContentType,5)="text/" then
HTML = HTML & " onmouseover=""ShowFile('" & RS("UploadID" & "')"" onmouseout=""HideFile()"""
end if
HTML = HTML & "><img border=0 src=dl.gif>" & "</A>"
HTML = HTML & " </td><td><strong><font face=Arial size=2>" & RS("Ganador" & "</font></strong><font size=1 color=gray>" & RS("Razag" & "</font></td><td><strong><font face=Arial size=2>" & RS("Perdedor" & "</font></strong><font size=1 color=gray>" & RS("Razap" & "</font>"
HTML = HTML & " </td><td><font face=Arial size=2>" & RS("Mapa" & "</font></td></tr>" & vbcrlf
RS.MoveNext
loop
HTML = HTML & "</Table>" & vbcrlf
DBList = HTML
RS.Close
end function
function GetConnection()
dim Conn, AuthConnectionString
' AuthConnectionString = "DBQ=" & Server.MapPath("upload.mdb" & ";DefaultDir=" & Server.MapPath("/" & ";" & _
' "Driver={Microsoft Access Driver (*.mdb)}; DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=5;UID=;"
AuthConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("upload.mdb"
Set Conn = Server.CreateObject("ADODB.Connection"
Conn.open AuthConnectionString
set GetConnection = Conn
end function
%>
</Script>