Skip to main content
Inspiring
January 30, 2007
Answered

syntax error in query expression

  • January 30, 2007
  • 1 reply
  • 581 views
I am receiving the following error message:

Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'customerid_cus='.

for the following code:

If IsEmpty(Request.Form("company_cus")) Then

rs_company.Source = "SELECT customerid_cus, company_cus FROM customers_cus WHERE customerid_cus= "& Request.QueryString("customerid") &" "

Else

rs_company.Source = "SELECT customerid_cus, company_cus FROM customers_cus WHERE company_cus = '"& Request.Form("company_cus") &"' "

End If

What could the problem be?
This topic has been closed for replies.
Correct answer Newsgroup_User
Are you sure that you are passing the querystring customerid when the form
company_cus is empty.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"aonefun" <webforumsuser@macromedia.com> wrote in message
news:epmf3n$f3u$1@forums.macromedia.com...
>I am receiving the following error message:
>
> Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
> in
> query expression 'customerid_cus='.
>
> for the following code:
>
> If IsEmpty(Request.Form("company_cus")) Then
>
> rs_company.Source = "SELECT customerid_cus, company_cus FROM
> customers_cus
> WHERE customerid_cus= "& Request.QueryString("customerid") &" "
>
> Else
>
> rs_company.Source = "SELECT customerid_cus, company_cus FROM
> customers_cus
> WHERE company_cus = '"& Request.Form("company_cus") &"' "
>
> End If
>
> What could the problem be?
>


1 reply

Newsgroup_UserCorrect answer
Inspiring
January 30, 2007
Are you sure that you are passing the querystring customerid when the form
company_cus is empty.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"aonefun" <webforumsuser@macromedia.com> wrote in message
news:epmf3n$f3u$1@forums.macromedia.com...
>I am receiving the following error message:
>
> Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
> in
> query expression 'customerid_cus='.
>
> for the following code:
>
> If IsEmpty(Request.Form("company_cus")) Then
>
> rs_company.Source = "SELECT customerid_cus, company_cus FROM
> customers_cus
> WHERE customerid_cus= "& Request.QueryString("customerid") &" "
>
> Else
>
> rs_company.Source = "SELECT customerid_cus, company_cus FROM
> customers_cus
> WHERE company_cus = '"& Request.Form("company_cus") &"' "
>
> End If
>
> What could the problem be?
>