<% Dim adoCon Dim rs Dim strSQL Dim blog Dim previous dim blogidnumber dim indexvalue dim photonumber dim albumname dim picnumber dim idlength dim albumlength dim nextnum dim count dim prevnum Set adoCon = Server.CreateObject("ADODB.Connection") adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../spfreaknet.mdb") blog = Request.QueryString("BlogID") If blog = "" Then strSQL = "SELECT * FROM randomthoughts ORDER BY blognumber DESC" ElseIf blog <> "" Then strSQL = "SELECT * FROM randomthoughts WHERE blognumber='" & blog & "'" End if Set rs = Server.CreateObject("ADODB.Recordset") rs.Open strSQL, adoCon blogurl = rs("blogfile") indexvalue = rs("index") blogidnumber= rs("blognumber") nextnum = blogidnumber + 1 prevnum = blogidnumber - 1 if len(nextnum) < 2 then nextnum = "000" & nextnum elseif len(nextnum) < 3 then nextnum = "00" & nextnum elseif len(nextnum) < 4 then nextnum = "0" & nextnum elseif len(nextnum) = 4 then nextnum = nextnum end if if len(prevnum) < 2 then prevnum = "000" & prevnum elseif len(prevnum) < 3 then prevnum = "00" & prevnum elseif len(prevnum) < 4 then prevnum = "0" & prevnum elseif len(nextnum) = 4 then nextnum = nextnum end if if prevnum = 0 then albumname = "archive.html" prevnum = "" end if %>
<% count = 1 rs.movefirst do while not rs.eof if count <> 5 then %> <% count = count + 1 end if rs.movenext loop %>
<% response.write rs("title") %>
<% response.write rs("blognumber") %> - <% response.write rs("date") %>

  <% Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile(Server.MapPath(rs("blognumber") + ".txt"), 1) Response.Write(f.ReadAll) f.Close Set f=Nothing Set fs=Nothing %>