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
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax error (missing operator) in query expression

    I have no problem in first time showing the data, with my sql as below
    Code:
    sql4="select * from tblFiles where WorkWeek >= "&request("Beginww")&" order by  WorkWeek DESC"
    but when I click on a link like below it will give me an syntax error(missing operator) but when I point to the link it giving me the correct link address for example if my Beginww= 15 then my link address will be
    http://abc/xyz/browsebypkg.asp?workweek>=15&page=2

    after I click on it the error come...
    my code is as below:

    Code:
    pagelink = "browsebypkg.asp?Workweek>="&request("Beginww")
    please help to solve this..tks

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Lose the ">". And your variables should be named the same if you are using the same variable from page to page.
    Code:
    pagelink = "browsebypkg.asp?Workweek="&request("Workweek")

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You might also try referencing it as Request.Form("Workweek").....If you leave out the ".Form" it may default to some other property of the Request object (like all querystrings concatenated together - I forget)

    Also, you really shold not pass an unchecked QueryString parm to a SQL statement. Do a google on "SQL Injection Attacks" to learn more.
    Robert
    Gee! Web Tools
    Web Content Management / Internet Marketing modules including:
    Page Editor - Calendar Manager - News Editor - Contact Organizer - Mail Wizard


  •  

    Posting Permissions

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