Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Basic ASP Search 2

Hi. Thankyou for replies my last message but alas, I am still having big problems with the same ASP page. To recap:

I have declared a variable:
dblSearchLower = Cdbl(Request.Form("lowFreq"))

Created a textbox:
" />

And used the following query:
strSQL = "SELECT licence_product" _
& "FROM products" _
& "WHERE lower_freq >= dblSearchLower;"

With the following variations on the final line:
& "WHERE lower_freq >= <%= dblSearchLower %>;"
& "WHERE lower_freq >= '"<%= dblSearchLower %>"';"
& "WHERE lower_freq >= '"&<%= dblSearchLower %>&"';"
& "WHERE lower_freq >= "&<%= dblSearchLower %>&";"
& "WHERE lower_freq >= & <%= dblSearchLower %>&;"
& "WHERE lower_freq >= &'"dblSearchLower"'&;"
& "WHERE lower_freq >= &"dblSearchLower"&;"
& "WHERE lower_freq >= '" & dblSearchLower &"';"
& "WHERE lower_freq >= &'"dblSearchLower"'&;"

The error message displayed always references the above line and refers to either an incorrect syntax, expected end of statement or unterminated string constant.

Please does anybody know of a solution to this?

Thankyou in advance.

Rob.

Comments

  • aagregoireaagregoire Posts: 5Member
    first, you should realy rethink using a sql string to access data, and use the ADO command object via a stored procedure saved in your database, also get rid of the semicolon and always keep your string on one line if possible.

    your code should read:(all on one line)
    strSQL = "SELECT licence_product FROM products WHERE lower_freq >=" & <%=dblSearchLower%>

    happy coding.


    : Hi. Thankyou for replies my last message but alas, I am still having big problems with the same ASP page. To recap:
    :
    : I have declared a variable:
    : dblSearchLower = Cdbl(Request.Form("lowFreq"))
    :
    : Created a textbox:
    : " />
    :
    : And used the following query:
    : strSQL = "SELECT licence_product" _
    : & "FROM products" _
    : & "WHERE lower_freq >= dblSearchLower;"
    :
    : With the following variations on the final line:
    : & "WHERE lower_freq >= <%= dblSearchLower %>;"
    : & "WHERE lower_freq >= '"<%= dblSearchLower %>"';"
    : & "WHERE lower_freq >= '"&<%= dblSearchLower %>&"';"
    : & "WHERE lower_freq >= "&<%= dblSearchLower %>&";"
    : & "WHERE lower_freq >= & <%= dblSearchLower %>&;"
    : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : & "WHERE lower_freq >= &"dblSearchLower"&;"
    : & "WHERE lower_freq >= '" & dblSearchLower &"';"
    : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    :
    : The error message displayed always references the above line and refers to either an incorrect syntax, expected end of statement or unterminated string constant.
    :
    : Please does anybody know of a solution to this?
    :
    : Thankyou in advance.
    :
    : Rob.
    :
    :

  • aagregoireaagregoire Posts: 5Member
    : first, you should realy rethink using a sql string to access data, and use the ADO command object via a stored procedure saved in your database, also get rid of the semicolon and always keep your string on one line if possible.
    :
    : your code should read:(all on one line)
    : strSQL = "SELECT licence_product FROM products WHERE lower_freq >='" & <%=dblSearchLower%> &'"
    :
    : happy coding.
    :
    :
    : : Hi. Thankyou for replies my last message but alas, I am still having big problems with the same ASP page. To recap:
    : :
    : : I have declared a variable:
    : : dblSearchLower = Cdbl(Request.Form("lowFreq"))
    : :
    : : Created a textbox:
    : : " />
    : :
    : : And used the following query:
    : : strSQL = "SELECT licence_product" _
    : : & "FROM products" _
    : : & "WHERE lower_freq >= dblSearchLower;"
    : :
    : : With the following variations on the final line:
    : : & "WHERE lower_freq >= <%= dblSearchLower %>;"
    : : & "WHERE lower_freq >= '"<%= dblSearchLower %>"';"
    : : & "WHERE lower_freq >= '"&<%= dblSearchLower %>&"';"
    : : & "WHERE lower_freq >= "&<%= dblSearchLower %>&";"
    : : & "WHERE lower_freq >= & <%= dblSearchLower %>&;"
    : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : : & "WHERE lower_freq >= &"dblSearchLower"&;"
    : : & "WHERE lower_freq >= '" & dblSearchLower &"';"
    : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : :
    : : The error message displayed always references the above line and refers to either an incorrect syntax, expected end of statement or unterminated string constant.
    : :
    : : Please does anybody know of a solution to this?
    : :
    : : Thankyou in advance.
    : :
    : : Rob.
    : :
    : :
    :
    :

  • aagregoireaagregoire Posts: 5Member
    : : first, you should realy rethink using a sql string to access data, and use the ADO command object via a stored procedure saved in your database, also get rid of the semicolon and always keep your string on one line if possible.
    : :
    : : your code should read:(all on one line)
    : : strSQL = "SELECT licence_product FROM products WHERE lower_freq >='" & <%=dblSearchLower%> & "'"
    : :
    : : happy coding.
    : :
    : :
    : : : Hi. Thankyou for replies my last message but alas, I am still having big problems with the same ASP page. To recap:
    : : :
    : : : I have declared a variable:
    : : : dblSearchLower = Cdbl(Request.Form("lowFreq"))
    : : :
    : : : Created a textbox:
    : : : " />
    : : :
    : : : And used the following query:
    : : : strSQL = "SELECT licence_product" _
    : : : & "FROM products" _
    : : : & "WHERE lower_freq >= dblSearchLower;"
    : : :
    : : : With the following variations on the final line:
    : : : & "WHERE lower_freq >= <%= dblSearchLower %>;"
    : : : & "WHERE lower_freq >= '"<%= dblSearchLower %>"';"
    : : : & "WHERE lower_freq >= '"&<%= dblSearchLower %>&"';"
    : : : & "WHERE lower_freq >= "&<%= dblSearchLower %>&";"
    : : : & "WHERE lower_freq >= & <%= dblSearchLower %>&;"
    : : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : : : & "WHERE lower_freq >= &"dblSearchLower"&;"
    : : : & "WHERE lower_freq >= '" & dblSearchLower &"';"
    : : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : : :
    : : : The error message displayed always references the above line and refers to either an incorrect syntax, expected end of statement or unterminated string constant.
    : : :
    : : : Please does anybody know of a solution to this?
    : : :
    : : : Thankyou in advance.
    : : :
    : : : Rob.
    : : :
    : : :
    : :
    : :
    :
    :

  • ssvasanssvasan Posts: 101Member
    Try with this one,

    strSQL = "SELECT licence_product FROM products WHERE lower_freq >= " & dblSearchLower






    : : : first, you should realy rethink using a sql string to access data, and use the ADO command object via a stored procedure saved in your database, also get rid of the semicolon and always keep your string on one line if possible.
    : : :
    : : : your code should read:(all on one line)
    : : : strSQL = "SELECT licence_product FROM products WHERE lower_freq >='" & <%=dblSearchLower%> & "'"
    : : :
    : : : happy coding.
    : : :
    : : :
    : : : : Hi. Thankyou for replies my last message but alas, I am still having big problems with the same ASP page. To recap:
    : : : :
    : : : : I have declared a variable:
    : : : : dblSearchLower = Cdbl(Request.Form("lowFreq"))
    : : : :
    : : : : Created a textbox:
    : : : : " />
    : : : :
    : : : : And used the following query:
    : : : : strSQL = "SELECT licence_product" _
    : : : : & "FROM products" _
    : : : : & "WHERE lower_freq >= dblSearchLower;"
    : : : :
    : : : : With the following variations on the final line:
    : : : : & "WHERE lower_freq >= <%= dblSearchLower %>;"
    : : : : & "WHERE lower_freq >= '"<%= dblSearchLower %>"';"
    : : : : & "WHERE lower_freq >= '"&<%= dblSearchLower %>&"';"
    : : : : & "WHERE lower_freq >= "&<%= dblSearchLower %>&";"
    : : : : & "WHERE lower_freq >= & <%= dblSearchLower %>&;"
    : : : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : : : : & "WHERE lower_freq >= &"dblSearchLower"&;"
    : : : : & "WHERE lower_freq >= '" & dblSearchLower &"';"
    : : : : & "WHERE lower_freq >= &'"dblSearchLower"'&;"
    : : : :
    : : : : The error message displayed always references the above line and refers to either an incorrect syntax, expected end of statement or unterminated string constant.
    : : : :
    : : : : Please does anybody know of a solution to this?
    : : : :
    : : : : Thankyou in advance.
    : : : :
    : : : : Rob.
    : : : :
    : : : :
    : : :
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.