Solved

VInterDev Select Query w/Criteria

Posted on 1997-07-23
3
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

623 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