Solved

VInterDev Select Query w/Criteria

Posted on 1997-07-23
3
195 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
Comment Utility
What type is UserID in the database?
0
 

Author Comment

by:jlow
Comment Utility
The UserID field type is 'text'.
0
 

Accepted Solution

by:
JamesN earned 100 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now