What error happen here?

Discussion in 'Web Design & Coding' started by Nismo83, Jun 8, 2003.

  1. Nismo83

    Nismo83 OSNN AZN Addict

    Messages:
    383
    <%

    Id3 = Request.Querystring("Id3")

    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("news.mdb"))

    sSQL = "SELECT * FROM messages WHERE Id3 = " & Id3

    Set Message = oConn.Execute(sSQL)

    Id1 = Message("Id1").Value
    Id2 = Message("Id2").Value
    Id3 = Message("Id3").Value

    Locked = Message("Locked").Value
    Password = Message("Password").Value
    %>
    <%
    sSQL2 = "SELECT * FROM messages WHERE Id2 = " & Id2 & " ORDER BY Id3 "
    Set action = oConn.Execute(sSQL2)
    %>


    <% Do While NOT action.EOF %>

    ContentRAW = action("Content").Value
    Content = emoticon(ContentRAW)

    Response.Write LinkURLs(Content)%>

    <% If Session("Mod") <> "" Then %>
    <% If action("OriginalMessage") <> "Yes" Then %>
    | <a href="Delete.asp?Id3=<%= Id3 %>" target="_new"><font color="Red">Del Message</font></a>
    <% End If %><% If action("OriginalMessage") <> "No" Then %> | <a href="Delete.asp?Id2=<%= Id2 %>" target="_new"><font color="Red"><b>Del Thread</b></font></a>
    <% End If %><% End If %>
    ><%
    action.MoveNext

    Loop
    %>

    ======================
    The id3 in the "delete.asp?id3" doesn't seems to loop and all of the message shown in the delete.asp?id3 have the same value. Why this is happening?
     
  2. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    Its ASP.

    Nuff said.

    Anyways, look for stray <% %> first, and fix all those. Then check if everything is all correct, i dont know if cAsE matters, if it does check that.

    Note: that using data straight from the GET line of a browser is not really smart, since any user could then kinda modify your SQL qeury.
     
  3. Nismo83

    Nismo83 OSNN AZN Addict

    Messages:
    383
    i found the error already.. not those <% .. %> problem.. anyway, thanks for your comment
     
  4. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA