For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2005 > please help SELECT









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author please help SELECT
Dib

2005-02-24, 3:55 pm

Hi,

I can't figure out what is wrong with this

StrSQLDUP = "SELECT * FROM tblINrDUPTest WHERE tblINRDUPTest.plan=" &
txtRTOValues

Set rsDUP = New ADODB.Recordset

rsDUP.CursorType = adOpenKeyset
rsDUP.LockType = adLockOptimistic
rsDUP.Open StrSQLDUP, Cn , , , adCmdText


it worked fine until I added WHERE tblINRDUPTest.plan=" & txtRTOValues

it is returning this error

-2147217900 Syntax error (missing operator) in query expression.

Please help.

Thanks
Dib


Dib

2005-02-24, 3:55 pm

got, it was missing =' & " ' " at the end

Thanks
Dib

"Dib" <NOTdibsSPAM@comNOSPAMcast.net> wrote in message
news:eEKKVzpGFHA.1176@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> I can't figure out what is wrong with this
>
> StrSQLDUP = "SELECT * FROM tblINrDUPTest WHERE tblINRDUPTest.plan=" &
> txtRTOValues
>
> Set rsDUP = New ADODB.Recordset
>
> rsDUP.CursorType = adOpenKeyset
> rsDUP.LockType = adLockOptimistic
> rsDUP.Open StrSQLDUP, Cn , , , adCmdText
>
>
> it worked fine until I added WHERE tblINRDUPTest.plan=" & txtRTOValues
>
> it is returning this error
>
> -2147217900 Syntax error (missing operator) in query expression.
>
> Please help.
>
> Thanks
> Dib
>
>



Saga

2005-02-24, 3:55 pm


Glad we could help!<g>


"Dib" <NOTdibsSPAM@comNOSPAMcast.net> wrote in message
news:%23p1IA3pGFHA.2280@TK2MSFTNGP15.phx.gbl...
> got, it was missing =' & " ' " at the end
>
> Thanks
> Dib
>
> "Dib" <NOTdibsSPAM@comNOSPAMcast.net> wrote in message
> news:eEKKVzpGFHA.1176@TK2MSFTNGP12.phx.gbl...
>
>



Andy

2005-02-24, 3:55 pm


Most of the problems like that you can solve by using:
Debug.Print
instead of
StrSQLDUP =

to see what accually is in your SQL

:-)

--- Andy

>-----Original Message-----
>got, it was missing =' & " ' " at the end
>
>Thanks
>Dib
>
>"Dib" <NOTdibsSPAM@comNOSPAMcast.net> wrote in message
>news:eEKKVzpGFHA.1176@TK2MSFTNGP12.phx.gbl...
tblINRDUPTest.plan=" &[color=darkred]
tblINRDUPTest.plan=" & txtRTOValues[color=darkred]
expression.[color=darkred]
>
>
>.
>

Jeff Johnson [MVP: VB]

2005-02-24, 8:55 pm


"Andy" <Andrzej7@hotmail.com> wrote in message
news:14b701c51aa1$99630f30$a601280a@phx.gbl...

> Most of the problems like that you can solve by using:
> Debug.Print
> instead of
> StrSQLDUP =
>
> to see what accually is in your SQL


Or Debug.Print StrSQLDUP


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com