Solved

VInterDev Select Query w/Criteria

Posted on 1997-07-23
3
227 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

739 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