Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    5

    Unanswered: Urgent help plz!

    Hiya, im trying to delete an news entry from my database. When i go to the page in the browser i get this error:

    "Error Type:
    Sun ONE ASP VBScript compilation (0x800A03F6)
    Expected 'End'
    /newsremove.asp line 30, column 43"

    Ive read several posts and searched google for hours and everytime its the same solution, theres and "end if" statement missing. But my little IF statement is complete as far as i know!

    Line 30 is: "delid=request("delid")"
    Code:
    <form action="newsremove.asp" method="post">
    Type in the ID of the post you wish to remove: <input type="text" name="delid" size=20><br>
    <b>Make sure its the right one! Once you delete a post it can't be recovered!!</b><br>
    <input type="submit" value="Im sure, remove this post!">
    </form>
    <%
    if request("delid") = "" then
    delid=request("delid")
    sql="DELETE * FROM news WHERE ID='"& delid"'"
    set rs=conn.execute(sql)
    end if
    
    		
    sql="SELECT * FROM news ORDER BY tid DESC"
    set rs=conn.execute(sql)
    		
    do until rs.eof
    response.write "<hr align=left width=300 size=2 color=black noshading>"
    response.write rs("TID") & " by " & rs("POSTER") & ". ID: " & rs("ID")
    rs.moveNext
    loop
    %>
    any tips or suggestions at all are more then welcome!!! im dying here!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    this is only part of your code right?? post the whole page as the end if problem might actually be being generated somewhere else.

  3. #3
    Join Date
    Jul 2004
    Posts
    94
    Hi,
    I cannot see the coding for database connectivity here.
    what's the name of this page. what I feel is in the present form you need to write only the following:

    <form action="newsremove.asp" method="post">
    Type in the ID of the post you wish to remove: <input type="text" name="delid" size=20><br>
    <b>Make sure its the right one! Once you delete a post it can't be recovered!!</b><br>
    <input type="submit" value="Im sure, remove this post!">
    </form>

    and in the newsremove.asp you need to write the sql coding .
    At the end of your code, you have to write
    rs.close
    conn.close

    but first of all make sure that you have written the coding for database connectivity.
    Priyanka
    Windows web hosting with ASP,.Net,PHP,Perl,MySQL support
    We help in making your dreams come true on internet!

  4. #4
    Join Date
    Sep 2004
    Posts
    5
    aaah i got it to work thanks for the help it was just some bug =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •