Solved

VInterDev Select Query w/Criteria

Posted on 1997-07-23
3
219 Views
Last Modified: 2013-12-25
I'm issuing a select query from a form handler to look up user id's and password values.  If I leave off the criteria, the query works fine, but for some reason, the where statement causes the error.

I'm using the DCC/DTC but I get the same error when I create the query manually.

"SELECT passwords.* FROM passwords WHERE (UserID = " & user & ")"

Error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access 97 Driver] Too few parameters. Expected 1.

This is a simple problem but it's driving me crazy.  I have several other queries in my application that are structured almost exactly like this one and they work.

Thanks in advance...
0
Comment
Question by:jlow
  • 2
3 Comments
 

Expert Comment

by:JamesN
ID: 1854563
What type is UserID in the database?
0
 

Author Comment

by:jlow
ID: 1854564
The UserID field type is 'text'.
0
 

Accepted Solution

by:
JamesN earned 100 total points
ID: 1854565
Try:

"SELECT passwords.* FROM passwords WHERE (UserID =' " & user & "')"

i.e. add single quotes around the parameter in the SQL string.

Hope this helps,
    James
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question