CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    How to pass parameters to a query in the DataEnvironment?

    Hi,

    How do I pass parameters to a query (Command Object) of a DataEnvironment? I am not being able to assign it in the Command Designer...

    Specifically I want my query to be something like
    SELECT fieldname1 FROM table1
    WHERE
    field2 = x;

    where the value of x should be changeable at runtime.
    And how do I build this query using the SQL builder applet?
    The database I'm using is Oracle 8.

    Thanks for your time.


  2. #2
    Join Date
    Jul 1999
    Posts
    104

    Re: How to pass parameters to a query in the DataEnvironment?

    to build up your sql string you should do something like

    sqlstring = "Select fieldname1 From table1 WHERE field2 = '" & x & "'"

    you have to use the ' signs if field2 is a text file



  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: How to pass parameters to a query in the DataEnvironment?

    in the command designer write your sQL command like this:
    select * from lahadr where name = ?

    if necessary modify the attributes of that parameter in the parameters tab of the command dialog.

    to pass that param in your vb code

    de.Command1 "meier"
    MsgBox de.rsCommand1.Fields(0)
    de.rsCommand1.Close





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured