Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB > Access Param (all records)

Status
Not open for further replies.

hussux

Programmer
Jan 11, 2001
19
0
0
GB
i'm wanting to execute a query in access to bring back certain records based upon a parameter called category which is a numeric value.

ie. passing 500015 - brings back all records with a category of disks.

I'm passing the parameter though VB's Data Environment, this all works fine until you ask it to bring back all categories.

ie. passing '&' instead of 500015

just locks up VB, Any Ideas???
 
I have a couple of questions and some suggestions. Are you accessing the database via DAO or ADO? It does make a difference. Is the query passed to the database or a stored procedure you are passing a parameter to, ie. the category number? One approach I have found that works quite well in a situation where you are using stored procedures and want to be able to both pass a parameter to a procedure as well as return all data with the parameter being a numeric field is to create two queries: one that is parameterized and the other is not. The problem one gets into with pattern matching for numbers, as far as I know, is that it does not work. It only works with text data. If you can make the "category" a text field in the database then the pattern matching will work just fine and you will only need one query. Dan Grogan
dan@siqual.com

"Absit prudentia nil rei publicae profitur."
Without common sense you ain't gonna have nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top