Command Parameter 
Author Message
 Command Parameter

The following was my original message :

  Please help me,
  I know how to create a command (cmd1) with parameter (prm1) in
  DATAENVIRONMENT (data1) and  a connection (cn1)).
  I know how to create and to use a command with parameter in VB code.

  BUT , how to use a command with parameter, created with
DATAENVIRONMENT,

             - connect to the database,
             - tell vb to pass the parameter to cmd1.

  Thanks for your help

  Paul-Andre

By trial and a lot of errors I finally have this working code :
------------------------------------------------------------------
Private Sub mnuAfficher_Click(Index As Integer)

Data1.cn1.Open

ccountry = InputBox("Pease enter a country name", "Report by country")
Data1.Commands("cm1").Parameters("prm1").Size = Len(ccountry)

Data1.cm1 (ccountry)

reportCountry.Show
End Sub
-----------------------------------------------
Is that the way, it's supposed to be done ?
If so why couldn't I find a simple example like mine ?

Now if someone could tell me (as a teacher, my students may ask
(hopefully)) :

- It look stupid to assign the size and pass the parameter to prm1,
   a better way ? (assign the value is not a interesting answer)

- If there were  several parameters is there a shorter way to reference
prm1,
   maybe by "activeconnection" but, please, how ?

- Why do I have to set a size (anything but 0) in prm1 setting (dialog
box) ?

Thanks for any help or comments

Paul-Andre



Sat, 17 Apr 2004 02:37:54 GMT  
 Command Parameter

Quote:
>   I know how to create a command (cmd1) with parameter (prm1) in
>   DATAENVIRONMENT (data1) and  a connection (cn1)).
>   I know how to create and to use a command with parameter in VB code.
>   BUT , how to use a command with parameter, created with
> DATAENVIRONMENT,

Paul-Andre
Check out the following Microsoft KB article:

HOWTO: Programmatically Set Parameter Values for a Command Object in the DataEnvironment
http://support.microsoft.com/support/kb/articles/Q273/8/21.ASP

The above KB article was found by doing a search at
http://search.support.microsoft.com/kb/c.asp
- Select Visual Basic
- Select Keyword Search option with (All Words)
- Enter "Data Environment"
- Click Go

--

Thanks,
Carl Prothman
Microsoft Visual Basic MVP
http://www.able-consulting.com



Sat, 17 Apr 2004 09:24:58 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. multiple ADO command parameters

2. ADO command parameter syntax

3. Registration Command Parameters

4. Command parameters for Regedit(calling from script)

5. Data Environment - Select Command - Parameters

6. SQL SELECT command parameter??

7. Command parameters in a Remote component.

8. host data type in data environment command parameters

9. Child Command Parameters - Help !!

10. SSOleDBGrid and Command Parameters

11. Data Environment Command Parameter

12. Access command parameters

 

 
Powered by phpBB® Forum Software