I am getting an error Please help if you can 
Author Message
 I am getting an error Please help if you can

I am getting "Expected end of statement" error where is my syntax wrong?

strSql = "select * " & _
             "from comm " & _
             "where Auto =  " & DBGrid1 & " & _
             "order by ordern"

THANKS!!!!



Thu, 26 Aug 2004 08:40:15 GMT  
 I am getting an error Please help if you can
dbgrid.???

You have to pass something!

Regards

Vortex


Quote:
> I am getting "Expected end of statement" error where is my syntax wrong?

> strSql = "select * " & _
>              "from comm " & _
>              "where Auto =  " & DBGrid1 & " & _
>              "order by ordern"

> THANKS!!!!



Thu, 26 Aug 2004 08:52:20 GMT  
 I am getting an error Please help if you can
Rick,

it looks like you have an unbalanced set of quotes -- as a minimum, there should
be an even number of them on every line.  Have a closer look at the line
containing the where clause.

Consider the following:
strSql = "select * from comm " & _
             "where Auto =  " & DBGrid1 & _
             "order by ordern"

If Auto is of type string/char, then you may want to consider something like
this:
strSql = "select * from comm where Auto =  '" & DBGrid1 &  "' order by ordern"

Note the single quotes around the value of DBGrid1.  This is a good case for
using the Command object with a Parameter for the where value..
strSql = "select * from comm where Auto=? order by ordern"

best regards,
roy fine

Quote:

> I am getting "Expected end of statement" error where is my syntax wrong?

> strSql = "select * " & _
>              "from comm " & _
>              "where Auto =  " & DBGrid1 & " & _
>              "order by ordern"

> THANKS!!!!



Thu, 26 Aug 2004 10:27:55 GMT  
 I am getting an error Please help if you can
Thanks Very much!!!!


Quote:
> Rick,

> it looks like you have an unbalanced set of quotes -- as a minimum, there
should
> be an even number of them on every line.  Have a closer look at the line
> containing the where clause.

> Consider the following:
> strSql = "select * from comm " & _
>              "where Auto =  " & DBGrid1 & _
>              "order by ordern"

> If Auto is of type string/char, then you may want to consider something
like
> this:
> strSql = "select * from comm where Auto =  '" & DBGrid1 &  "' order by
ordern"

> Note the single quotes around the value of DBGrid1.  This is a good case
for
> using the Command object with a Parameter for the where value..
> strSql = "select * from comm where Auto=? order by ordern"

> best regards,
> roy fine




- Show quoted text -

Quote:
> > I am getting "Expected end of statement" error where is my syntax wrong?

> > strSql = "select * " & _
> >              "from comm " & _
> >              "where Auto =  " & DBGrid1 & " & _
> >              "order by ordern"

> > THANKS!!!!



Thu, 26 Aug 2004 14:34:50 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Please Help: Why am I now getting this error

2. Help - I am getting an error using data control

3. error 91 please help as i am stuck

4. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

5. Please, please help, I am desperated...:(

6. PLEASE, PLEASE HELP, am I going MAD - Generating Totals

7. why am I getting this error??

8. Null Values - WHY am I getting this error?

9. VB4 16-bits: I am getting an error message when compiling

10. I am getting errors I can't pin down

11. Why am I getting this error ?

12. i am getting error sending stdPic to out-of-Process Component

 

 
Powered by phpBB® Forum Software