Updateing a record

Discussion in 'ASP General' started by Magua, Feb 2, 2006.

  1. Magua

    Magua Guest

    Whenever i try to update a record i always get the dreaded "No
    permissions"
    here is my updates statement. Please help.

    Function updateData()
    cid = Request.QueryString("wrkstaID")
    sql="UPDATE work_station SET "
    sql=sql & "workstation='" & Request.QueryString("workstation") & "',"
    sql=sql & "cpu='" & Request.QueryString("cpu") & "',"
    sql=sql & "memory='" & Request.QueryString("memory") & "',"
    sql=sql & "hard_Drive='" & Request.QueryString("harddrive") & "',"
    sql=sql & "servicepack='" & Request.QueryString("servicepack") & "',"
    sql=sql & " WHERE work_StationID='" & cid & "'"
    on error resume next
    conn.Execute sql
    if err<>0 then
    response.write("No update permissions!")
    else
    response.write("Record " & cid & " was updated!")
    updateData = True
    end if
    'conn.close

    End Function
    Magua, Feb 2, 2006
    #1
    1. Advertising

  2. Magua

    Evertjan. Guest

    Magua wrote on 02 feb 2006 in microsoft.public.inetserver.asp.general:

    > Whenever i try to update a record i always get the dreaded "No
    > permissions"
    > here is my updates statement. Please help.
    >
    > Function updateData()
    > cid = Request.QueryString("wrkstaID")
    > sql="UPDATE work_station SET "
    > sql=sql & "workstation='" & Request.QueryString("workstation") & "',"
    > sql=sql & "cpu='" & Request.QueryString("cpu") & "',"
    > sql=sql & "memory='" & Request.QueryString("memory") & "',"
    > sql=sql & "hard_Drive='" & Request.QueryString("harddrive") & "',"
    > sql=sql & "servicepack='" & Request.QueryString("servicepack") & "',"
    > sql=sql & " WHERE work_StationID='" & cid & "'"
    > on error resume next
    > conn.Execute sql
    > if err<>0 then
    > response.write("No update permissions!")
    > else
    > response.write("Record " & cid & " was updated!")
    > updateData = True
    > end if
    > 'conn.close
    >
    > End Function
    >


    You could be catching all other kinds of errors!

    Change:

    conn.Execute sql

    to:

    debug = true
    if debug then
    response.write sql
    response.end
    else
    conn.Execute sql
    end if

    and show us the output.

    btw, also tell us the type of database engine and your
    set con =
    line


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Feb 2, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jake
    Replies:
    7
    Views:
    3,713
    Steve Letford
    Aug 7, 2003
  2. Jake
    Replies:
    1
    Views:
    287
    Craig Deelsnyder
    Jun 25, 2004
  3. Jake
    Replies:
    2
    Views:
    300
    Guest
    Jul 2, 2004
  4. nialltimpson

    updateing applets

    nialltimpson, Mar 5, 2005, in forum: Java
    Replies:
    3
    Views:
    339
    nialltimpson
    Mar 6, 2005
  5. Matt D
    Replies:
    1
    Views:
    170
    Bob Barrows
    Dec 2, 2003
Loading...

Share This Page