Pls help with Error Message

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Pls help with Error Message

    I am reusing a code that has been already working fine in another part
    of our website. I am using the same table structure and datatypes too.
    I am getting the following error message:

    Microsoft JET Database Engine error '80040e14'
    Syntax error (missing operator) in query expression 'CustomerID ='.
    /test/ins_VIPPuserlinks.asp, line 183

    This is the statement where the problem is:
    user_id = session("user_id")
    CustomerID = request("CustomerID")
    set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
    CustomerID = " & CustomerID)
    if not rs.EOF then
    Supplier = rs("Supplier")
    VIPP_URL = rs("Web_Address")

    NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
    User_Links table.

    Code from Links page to add link to favorits:
    <% if session("user_id") <> "" then %>[<A
    href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
    class='labelTD'>add to favorites</A>]<% end if %>

    I can't figure out where I am missing the missing operator...please
    HELP!
    Maria Kovacs Guest

  2. Similar Questions and Discussions

    1. How To Supress Acrobat Error Message And Alert Message
      Is there any way to supress those pop up message? If can't, is there any way to catch it?
    2. error message: Microsoft JScript compilation error '800a03ec'
      Recieved following error message: Microsoft JScript compilation error '800a03ec' Expected ';' ...
    3. Error Message When Sending Message In Windows Mail
      Am I the only one getting an error message when replying to a posted message using Windows Mail. Every time I send a message I get a popup error...
    4. Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
      I am running Acrobat Reader 5.0 on a Mac Powerbook running OS 9.2 and keep getting "A drawing error occurred which is probably due to an out of...
    5. ODBC has error but no error message displayed
      Hi All.. This is a strange one that I hope someone has come across. I have an asp.net application that needs to access a flat file databse via...
  3. #2

    Default Re: Pls help with Error Message

    response.write "SELECT Supplier, Web_Address FROM VIPP WHERE
    CustomerID = " & CustomerID
    response.end

    before cn.Execute
    and you'll see the problem.
    request("CustomerID") is returning an empty string.

    "Maria Kovacs" <mariakovacs@lycos.com> wrote in message
    news:6f76be22.0310091217.459f081@posting.google.co m...
    > I am reusing a code that has been already working fine in another part
    > of our website. I am using the same table structure and datatypes too.
    > I am getting the following error message:
    >
    > Microsoft JET Database Engine error '80040e14'
    > Syntax error (missing operator) in query expression 'CustomerID ='.
    > /test/ins_VIPPuserlinks.asp, line 183
    >
    > This is the statement where the problem is:
    > user_id = session("user_id")
    > CustomerID = request("CustomerID")
    > set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
    > CustomerID = " & CustomerID)
    > if not rs.EOF then
    > Supplier = rs("Supplier")
    > VIPP_URL = rs("Web_Address")
    >
    > NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
    > User_Links table.
    >
    > Code from Links page to add link to favorits:
    > <% if session("user_id") <> "" then %>[<A
    > href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
    > class='labelTD'>add to favorites</A>]<% end if %>
    >
    > I can't figure out where I am missing the missing operator...please
    > HELP!

    Raymond D'Anjou \(raydan\) Guest

  4. #3

    Default Re: Pls help with Error Message

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:ekcQ9VqjDHA.2068@TK2MSFTNGP09.phx.gbl...
    > And after you get that working right, change your code to specify what
    > collection you're trying to pull the value from. Request.FORM, .COOKIES,
    > .QUERYSTRING, etc.
    I have pages where a value is passed either through request.form("value") or
    request.querystring("value").
    I use request("value") all the time in this case without specifying where
    it's coming from.


    Raymond D'Anjou \(raydan\) Guest

  5. #4

    Default Re: Pls help with Error Message

    And after you get that working right, change your code to specify what
    collection you're trying to pull the value from. Request.FORM, .COOKIES,
    ..QUERYSTRING, etc.

    Ray at work

    "Raymond D'Anjou (raydan)" <raydan@canatrade.nospamcom> wrote in message
    news:edLQLQqjDHA.360@TK2MSFTNGP10.phx.gbl...
    > response.write "SELECT Supplier, Web_Address FROM VIPP WHERE
    > CustomerID = " & CustomerID
    > response.end
    >
    > before cn.Execute
    > and you'll see the problem.
    > request("CustomerID") is returning an empty string.
    >
    > "Maria Kovacs" <mariakovacs@lycos.com> wrote in message
    > news:6f76be22.0310091217.459f081@posting.google.co m...
    > > I am reusing a code that has been already working fine in another part
    > > of our website. I am using the same table structure and datatypes too.
    > > I am getting the following error message:
    > >
    > > Microsoft JET Database Engine error '80040e14'
    > > Syntax error (missing operator) in query expression 'CustomerID ='.
    > > /test/ins_VIPPuserlinks.asp, line 183
    > >
    > > This is the statement where the problem is:
    > > user_id = session("user_id")
    > > CustomerID = request("CustomerID")
    > > set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
    > > CustomerID = " & CustomerID)
    > > if not rs.EOF then
    > > Supplier = rs("Supplier")
    > > VIPP_URL = rs("Web_Address")
    > >
    > > NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
    > > User_Links table.
    > >
    > > Code from Links page to add link to favorits:
    > > <% if session("user_id") <> "" then %>[<A
    > > href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
    > > class='labelTD'>add to favorites</A>]<% end if %>
    > >
    > > I can't figure out where I am missing the missing operator...please
    > > HELP!
    >
    >

    Ray at Guest

  6. #5

    Default Re: Pls help with Error Message

    I suggest you don't do that. Decide which one is more important, and use
    if/then to get the value.

    sVal = REquest.Querystring("value")
    If sVal = "" Then sVal = Request.Form("value")

    Ray at work

    "Raymond D'Anjou (raydan)" <raydan@canatrade.nospamcom> wrote in message
    news:OPG0iaqjDHA.2232@TK2MSFTNGP09.phx.gbl...
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:ekcQ9VqjDHA.2068@TK2MSFTNGP09.phx.gbl...
    > > And after you get that working right, change your code to specify what
    > > collection you're trying to pull the value from. Request.FORM,
    ..COOKIES,
    > > .QUERYSTRING, etc.
    >
    > I have pages where a value is passed either through request.form("value")
    or
    > request.querystring("value").
    > I use request("value") all the time in this case without specifying where
    > it's coming from.
    >
    >

    Ray at Guest

  7. #6

    Default Re: Pls help with Error Message

    > I have pages where a value is passed either through request.form("value")
    or
    > request.querystring("value").
    > I use request("value") all the time in this case without specifying where
    > it's coming from.
    Ugh. What happens when you foolishly name a form element something that the
    browser is posting into servervariables? Or when another developer creates
    a cookie with the same key name as one of your form elements? See this
    article: [url]http://www.aspfaq.com/2111[/url]


    Aaron Bertrand - MVP Guest

  8. #7

    Default Re: Pls help with Error Message

    I was going to ask Ray WHY.
    Sorry, I guess I'm running with the wrong crowd at work.
    I'm try to show them the right path.

    "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
    news:uZMUolqjDHA.1096@TK2MSFTNGP11.phx.gbl...
    > > I have pages where a value is passed either through
    request.form("value")
    > or
    > > request.querystring("value").
    > > I use request("value") all the time in this case without specifying
    where
    > > it's coming from.
    >
    > Ugh. What happens when you foolishly name a form element something that
    the
    > browser is posting into servervariables? Or when another developer
    creates
    > a cookie with the same key name as one of your form elements? See this
    > article: [url]http://www.aspfaq.com/2111[/url]
    >
    >

    Raymond D'Anjou \(raydan\) Guest

  9. #8

    Default Re: Pls help with Error Message

    I think I found where my problem is. I just don't know how to fix it,
    I am fairly new with ASP...so please bear with me.

    So I traced the problem back to the previous page that is although I
    have the sql statement correct my CustomerID does not get selected.

    Generally I am displaying records into a table like this:
    <td><%= rs("CustomerID") %></td>
    Which works...but I need to carry the customerID over to the next page
    so my code looks like this:

    <% if session("user_id") <> "" then %>[<A
    href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'>add to
    favorites</A>]<% end if %>

    Unfortunately then instead of the page ins_VIPPuserlinks.asp I get the
    error message that the CusomterID is missing the value.

    The code for ins_VIPPuserlinks.asp is here:
    [url]http://cliq-on.com/test/vipp.txt[/url]
    Maria Kovacs Guest

  10. #9

    Default Re: Pls help with Error Message

    Hi Maria,

    To carry values from one page to another, you either use cookies,
    session/application varibles, form data, querystring, or probably something
    else I'm not thinking of.

    How are you getting from page1 to page2? Is it by a server-side redirect,
    or is it when the user clicks a link?

    Also, you should use:
    <%=rs.Fields.Item("CustomerID").Value%> instead of <%=rs("CustomerID")%>
    If you're new to ASP, try to get yourself in that habit now of not relying
    on default properties. It'll save you headaches.

    Ray at home

    "Maria Kovacs" <mariakovacs@lycos.com> wrote in message
    news:6f76be22.0310130948.518d95d4@posting.google.c om...
    > I think I found where my problem is. I just don't know how to fix it,
    > I am fairly new with ASP...so please bear with me.
    >
    > So I traced the problem back to the previous page that is although I
    > have the sql statement correct my CustomerID does not get selected.
    >
    > Generally I am displaying records into a table like this:
    > <td><%= rs("CustomerID") %></td>
    > Which works...but I need to carry the customerID over to the next page
    > so my code looks like this:
    >
    > <% if session("user_id") <> "" then %>[<A
    > href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'>add to
    > favorites</A>]<% end if %>
    >
    > Unfortunately then instead of the page ins_VIPPuserlinks.asp I get the
    > error message that the CusomterID is missing the value.
    >
    > The code for ins_VIPPuserlinks.asp is here:
    > [url]http://cliq-on.com/test/vipp.txt[/url]

    Ray at Guest

  11. #10

    Default Re: Pls help with Error Message

    Hi Ray,
    You are right! I will corrected properties as you suggested and
    suddenly things began to work that until now were a pain to figure
    out.

    Now I actually managed to pull the CustomerID into a link ex.:
    .../test/ins_VIPPuserlinks.asp?CustomerID=78
    I managed to pull most of the values that need to show or inserted.
    However when I click the confirm insert button of the form it seems to
    clear the form instead of inserting values. What would be the reason
    for that?

    I have another question. One of the values that will be inserted into
    the favorits table (VIPPid(Autonumber), user_id, CustomerID), is an
    autonumber. How would I go about it in my insert statement? Do I need
    to list it or it gets generated automatically?

    > How are you getting from page1 to page2? Is it by a server-side redirect,
    > or is it when the user clicks a link?
    I am getting from page 1 to 2 by clicking an "Add to Favorits" link
    that goes through a page that has all the the functions for
    adding/updating/deleting these favorits. On this page I actually have
    a small form that confirms the data insert. That form calls a function
    inside the same page and "redirects" to the same page with a message
    whether the insert was successful.

    I am sorry if I am hazy on some of the explanation but I feel like I
    am swimming in deep water here. Until now I just installed ready to
    use codes, but now I am actually trying to add to them by myself. The
    fact that I never studied programming does not help... :)

    Maria
    Maria Kovacs Guest

  12. #11

    Default Re: Pls help with Error Message

    It will be inserted automatically. Just leave the column out of your insert
    command altogether.

    INSERT INTO TheTable ([user_id],[CustomerID]) VALUES ('x','y')

    Ray at work

    "Maria Kovacs" <mariakovacs@lycos.com> wrote in message
    news:6f76be22.0310141042.371e4bbc@posting.google.c om...
    >
    > I have another question. One of the values that will be inserted into
    > the favorits table (VIPPid(Autonumber), user_id, CustomerID), is an
    > autonumber. How would I go about it in my insert statement? Do I need
    > to list it or it gets generated automatically?

    Ray at Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139