|
-
Jul 11th, 2006, 01:54 AM
#1
Thread Starter
Junior Member
[RESOLVED] sql problem
i am trying to get some records from my database(ms access) using an sql command.
what is wrong with this?
adoPrimaryRS.Open "select field3 from 345_POLICY where field3 = " & usermotor & "", db, adOpenStatic, adLockOptimistic
when i run the program i get the error
syntax error(missing operator) in query expression 'field3 = 333'.
please help
-
Jul 11th, 2006, 01:58 AM
#2
Re: sql problem
If field3 is non-numeric then you will have to include apostrophes in your query like this
VB Code:
adoPrimaryRS.Open "select field3 from 345_POLICY where field3 = '" & usermotor & "'", db, adOpenStatic, adLockOptimistic
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jul 11th, 2006, 02:07 AM
#3
Thread Starter
Junior Member
-
Jul 11th, 2006, 02:18 AM
#4
Re: sql problem
 Originally Posted by petros
thanks a lot that work!
You are welcome. PLease make sure you mark your thread resolved by opening thread tools at the top of this thread and select Mark Thread Resolved from the Menu.
Use [code] source code here[/code] tags when you post source code.
My Articles
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
|