Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Need help

  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help

    Every time I run the script below, I get "No update permissions!"

    Thanks in advance.


    <html>
    <body>

    <h2>Update Record</h2>
    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open(Server.mapPath("chem.mdb"))

    cid=Request.Form("submit")
    response.write(Request.Form("test1"))
    jon = 1
    response.write(jon)

    if Request.form("test1")<>"" then

    sql="UPDATE NEWS SET "
    sql=sql & "DATE='" & now() & "',"
    sql=sql & "CONTENT='" & Request.Form("test1") & "'"
    sql=sql & " WHERE ID='" & jon & "'"
    on error resume next
    conn.Execute sql, Recordsaffected
    if err<>0 then
    response.write("No update permissions!")
    else
    response.write("Record " & cid & " was updated!")
    end if
    end if
    conn.close
    %>

    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Need help
    Hi rohmanovich, my first advise to you is never to name a thread "Need help" It's against our posting guidelines. See http://www.codingforums.com/postguide.htm for the complete list of guidelines.
    Now to your question, I'll advise you to remove the error handler so you can see the specific error message that occurs.
    In order words, remove these lines

    Code:
     on error resume next
    and
    Code:
    if err<>0 then
    response.write("No update permissions!")
    else
    response.write("Record " & cid & " was updated!")
    end if
    By so doing, you'll get the specific error message. Revert back to us with the error message if you're still having problems.
    Cheers
    Last edited by tboss132; 12-29-2004 at 08:26 AM. Reason: typo
    Tomorrow is the first day of the rest of your life... What have you done today?
    Tutorials
    Web: w3schools, htmldog General tips: Hardware, Networking

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    And it sounds to me like your Web host should have some kind of admin area for you to use or else you might have to call or e-mail them what you want. The anonomous Internet user needs write permissions on the virtual folder.
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

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