Pass string to dataenvironment 
Author Message
 Pass string to dataenvironment
Hi,
   What data type and host datatype value should I set if I want to pass
STRING as parameter to dataenvironment.mycommand? I tried the followng
setting, but no result .

   SELECT * FROM mytable WHERE Name = ?

   Dataenvironment.mycommand.parameter

   Datatype = adBSTR
   Host Datatype = STRING(VT_BSTR)

   I have tried to subsitute the "?" with string value, it works. What
mistakes have I make??

Thank you



Tue, 25 Dec 2001 03:00:00 GMT
 Pass string to dataenvironment

My best bet when passing parameters is to use the PARAMETERS statement in
the SQL itself.  Here is an example:

PARAMETERS MyParm TEXT;
SELECT * FROM TestTable WHERE MyTestField = MyParm;

MSDN docs state this format for the PARAMETERS statement:
PARAMETERS name datatype [, name datatype [, ...]]

datatype can be any valid MS Jet SQL data type.

The named parameter shows up in the Parameters tab of the Command Properties
dialog.
To pass the parameter to the command use a syntax similar to the following:

DataEnvironment1.MyCommand "This is the data I am passing in which happens
to be a string."

Hope this helps.
--

Jefferson Baker - Software Engineer
Bently Nevada Corporation


Quote:
> Hi,
>    What data type and host datatype value should I set if I want to pass
> STRING as parameter to dataenvironment.mycommand? I tried the followng
> setting, but no result .

>    SELECT * FROM mytable WHERE Name = ?

>    Dataenvironment.mycommand.parameter

>    Datatype = adBSTR
>    Host Datatype = STRING(VT_BSTR)

>    I have tried to subsitute the "?" with string value, it works. What
> mistakes have I make??

> Thank you



Wed, 26 Dec 2001 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Trouble passing a parameter to a DataEnvironment command

2. How to pass parameter to DataEnvironment (stored proc)

3. Passing a time as a DataEnvironment command parameter

4. passing parameters in dataEnvironment command

5. How to pass a new SQL query using the DATAEnvironment

6. Q: Stored Procedure + Dataenvironment Returning Strings

7. SQL string of command object in DataEnvironment

8. Modify DataEnvironment Connection Strings at Run-Time

9. Password in a connection string with DataEnvironment

10. Changing the DataEnvironment Connection String programmaticly

11. Help: Adding DataEnvironment Child Command Screws Up DataEnvironment

12. how to pass string to IN expecting int type in sp


 
Powered by phpBB® Forum Software