Help needed: Setting parameters in parameter queries

Help needed: Setting parameters in parameter queries

Post by Erik Sieg » Tue, 22 Aug 1995 04:00:00

I am trying to write a generic routine that sets parameters for parameter
queries (VB PE 3.0), because I want to do some centralized error handling
when a parameter is used in ocde but not defined in the query and

However, I cannot find a way passing the query parameter name as a

For instance:

I have a querydef called qd and it has a parameter called par.
To set the value of this parameter I must write something like

        qd!par = "..."

But now I have a string variable, lets say sParameterName, which
contains "par", and I want to use it to set the querydef parameter.
So something like:

        qd(sParameterName) = "..."

It seems that there is no way to do this. Does anybody has a clue,
knows a solution or can give me a definite "no it can't" on this?

Erik Siegel

PS: Please CC an answer to me if you can.

Erik Siegel                     | Telephone: +31 50 855336
PTT Telecom BV                  | Telefax  : +31 50 855310

P.O. Box 188                    | DISCLAIMER: This statement is not an
NL-9700 AD Groningen            | statement from, nor does it represent
The Netherlands                 | official position of, PTT Telecom B.V.


Help needed: Setting parameters in parameter queries

Post by Anders Bjuresti » Wed, 23 Aug 1995 04:00:00

Hallo Colleague!

I tried to do something like that. I tried to connect a
parameterquery(.mdb) to my data control and I was told that it
wasn't possible. So I used a query(mdb) which I connect with a
SQL statement in VB. This works fine. I didnt want to handle all
the errors if a wrong parameter was entered, but I tried it and
it worked, so now I use a default start and the user can change
it afterward. If you need some example code for the SQL-statement
I have a working one. Otherwise you can allways try the
searchengine at Carl&Gary.

Hope this help

Transmission engineer
Telia, South Region


1. calling parameter query from a parameter query

  This is realy an SQL question.  I have a Acces SQL query
which takes a string parameter which gets a unique record
several fields.  One of those fields is numeric and i want
to take that value and call another query which will take
that nmeric value.

The problem is the prompt for the second query keeps
coming up asking for the numeric value.
How can I make it so, through SQL, so that paramter is
populated with the numeric value filed form the 1st querry.

The query called Mon_Paras takes a number, which I want to
be Mons.MNum but I can't figure it out.
The SQL for Mon_Paras is a big, messy thing with many Left
joins and I'd perfer not to write one single query.
The Access SQL

SELECT Mons.*, Mons_Paras.*
FROM Mons, Mons_Paras
WHERE (((Mons.[Minor Name])=[MName]));


2. Using LOCAL-SQL or Transact-SQL with SQL-server and BDE

3. Need help setting parameter value

4. java interface to express

5. Need help: Setting up parameter for VC++4.00 to compile FOXLiB

6. Multiple or Single tablespace

7. Need help with this WHERE clause in parameter query


9. Help with SQL parameter query needed!

10. Need Help passing Parameters to SQL query in a VB dataenviroment

11. Help Needed With Parameter Queries


13. Using Parameter Queries with Optional Parameters