Alpha DevCon 2018
Results 1 to 3 of 3

Thread: code help with a5w page & table entry

  1. #1
    Member
    Real Name
    Rick Knight
    Join Date
    Aug 2006
    Location
    Cincinnati, Oh
    Posts
    27

    Default code help with a5w page & table entry

    This is a code issue that I have been trying to resolve for some time.
    After a user leaves a web survey database (customer_survey) they
    are redirected to "deactivate_customer.a5w" for the
    purpose of changing the "user_status" from "active" to "inactive"
    in the surveyusers.db. The idea is to prevent the logged on
    user from re-enterng the survey after this point.

    The code in the a5w page is:
    -----
    <body>
    <%a5
    tbl = table.open("ADB_Path\surveyuser_names")
    query.filter= "user_name=" +quote(session.survey.username)
    indx = tbl.query_create()
    update.fields = 1
    update.field1 = "user_status"
    update.expr1 = "inactive"
    tbl.update()
    tbl.close()
    respone.redirect("index.htm")
    %></body>
    ------

    The server error is:
    5OO Internal Server error

    Script error
    Error: deactivate_customer.a5w line:15
    tbl.update()
    Variable update.expr1 references a non-existent field INACTIVE.

    ------

    This does not make sense to me as the field "user_status" exists and
    the only two allowable choices are "active" and "inactive"

    Any thoughts on this???

  2. #2
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,575

    Default Re: code help witha5w page & table entry

    Rick,

    Have you tried

    <%a5
    tbl = table.open("ADB_Path\surveyuser_names")
    query.filter= "user_name=" +quote(session.survey.username)
    indx = tbl.query_create()
    tbl.change_begin()
    tbl.user_status="inactive"
    tbl.change_end()
    tbl.close()
    respone.redirect("index.htm")
    %>

    By the way, if thes is an Xbasic script only, you don't need the <body></body> tags around the script.

  3. #3
    Member
    Real Name
    Rick Knight
    Join Date
    Aug 2006
    Location
    Cincinnati, Oh
    Posts
    27

    Default Re: code help with a5w page & table entry

    Thanks and a "tip of the hat" to you: this code worked just fine.
    Rick

Similar Threads

  1. Copy A5W code object from page to page
    By Steve Wood in forum Archived Wishlist
    Replies: 0
    Last Post: 03-19-2007, 11:43 PM
  2. How to create a a5w page without html code
    By B.B.Bongers in forum Web Application Server v7
    Replies: 2
    Last Post: 06-28-2006, 02:41 PM
  3. Open a a5w page from an a5w page
    By chandran in forum Web Application Server v7
    Replies: 2
    Last Post: 02-02-2006, 03:02 PM
  4. A5W "Contact us" page info populating a database table
    By KimberlyPatt in forum Web Application Server v7
    Replies: 5
    Last Post: 12-28-2005, 09:57 AM
  5. hidden "leftover" table in A5W page
    By Steve Wood in forum Web Application Server v6
    Replies: 3
    Last Post: 09-16-2004, 03:18 PM

Bookmarks

Posting Permissions

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