Results 1 to 4 of 4

Thread: [RESOLVED] Data Report:Setting commandText of DataEnvironment with parameters

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Dublin, Ireland
    Posts
    120

    Resolved [RESOLVED] Data Report:Setting commandText of DataEnvironment with parameters

    Hi,
    I'm currently using the Data Report facility of VB6 and am quite new to it.
    Wondering how I can set the commandText of the command facility under the dataenvironment with variables I have passed into the report?

    My commandText string of the command is like this:
    SELECT * FROM tblcustomersection where RequestNo > '" & requestNoStart & "' and RequestNo < '" & requestNoEnd & "' order by RequestNo

    requestNoStart and requestNoEnd are variables I've passed into the generated report but unfortunatley these don't seem to be picked up by the commandText.
    Hope I'm doing something basic wrong.
    Thanks.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Data Report:Setting commandText of DataEnvironment with parameters

    Moved to reporting

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Dublin, Ireland
    Posts
    120

    Resolved Re: Data Report:Setting commandText of DataEnvironment with parameters

    Hi actually solved this. The string should read:
    SELECT * FROM tblcustomersection where RequestNo > ? and RequestNo < ? order by RequestNo
    One can then right click on the sql statement in the data environment, select properties, and select the parameters tag. For each parameter set, it is picked up by a ?.
    Then to pass the parameters to the sql statement it goes like this:
    Assume the data environment is called 'data', and the command created is called 'command1', say the parameters created are 'param1' and 'param2'
    Code: data.command1 param1,param2
    My difficulty arose in the fact I couldn't understand why I couldn't set the parameters in the original sql statement.
    Thanks for all replies and hope this has helped someone.

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    18

    Re: [RESOLVED] Data Report:Setting commandText of DataEnvironment with parameters

    Referring to the attached DE.
    What could be the passing parameter?

    DE.Command1(10) is not working
    EXP1 = Bill Number
    It says wrong number of arguments.

    REPLY!
    Attached Images Attached Images  

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