|
-
Apr 10th, 2007, 06:07 AM
#1
Thread Starter
Lively Member
[RESOLVED] Correct my SQL stt (wait, trying to see in FAQs)
Can anyone help me correct syntax error(s) in the following code:
MyRSDetails.Open "SELECT tblClients.ClientCode, tblClients.* FROM tblClients" & _
"WHERE tblClients.ClientCode = '" & strClientID & "';", conn, adOpenKeyset, adLockOptimistic
Runtime error : Syntax error in FROM clause.
Thank u
Last edited by MintFlavor; Apr 10th, 2007 at 06:11 AM.
-
Apr 10th, 2007, 06:11 AM
#2
Re: Correct my SQL stt (wait, trying to see in FAQs)
Code:
MyRSDetails.Open "SELECT * FROM tblClients" & _
" WHERE tblClients.ClientCode = '" & strClientID & "'", conn, adOpenKeyset, adLockOptimistic
Last edited by amrita; Apr 10th, 2007 at 06:21 AM.
-
Apr 10th, 2007, 06:12 AM
#3
Re: Correct my SQL stt (wait, trying to see in FAQs)
Yeah - you need a space after the table name.
Best thing is to put the sql statement into a string variable then you can debug.print it (or breakpoint n check it).
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Apr 10th, 2007, 06:14 AM
#4
Frenzied Member
Re: Correct my SQL stt (wait, trying to see in FAQs)
You need a space between tblClients and WHERE.
The semicolon is ok but not needed.
If ClientCode is a numeric field, you'll need to use a numeric variable, not a string.
Tengo mas preguntas que contestas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|