Results 1 to 5 of 5

Thread: DED, report designer, & setting recordsets

  1. #1

    Thread Starter
    Addicted Member P.S.W.'s Avatar
    Join Date
    Aug 2000
    Posts
    146

    Question

    Hi everybody!

    I am trying to create a program that will create reports using a range of data that the user specifies. I am using the DED and Data Report Designer.

    My problem is this: I have a pop-up form collect the range of dates for preparing the report, and then I try to reset the SQL statement for the appropriate command object/recordset using those dates, then show the report. I can't figure out how to make it work.

    First off, the DED recordsets don't support a "refresh" method. Also, after changing the .Source property to reflect the modified SQL, the report still prints out -all- the dates. If anyone can help me with the steps/code necessary to make this work I would be grateful.





  2. #2
    Addicted Member
    Join Date
    May 2000
    Posts
    188
    Try this... set up the command in the dataenvironment to return a recordset and use two parameters (ie. your two dates). then when you have the two dates open the command using the two input dates as the parameters. Then open the report.

    If you need more help or if any part of this is unclear let me know.

  3. #3

    Thread Starter
    Addicted Member P.S.W.'s Avatar
    Join Date
    Aug 2000
    Posts
    146
    Nathan,

    Thanks for your help. I've been looking through my DB books and I think I have a handle on creating a parameterized query in SQL --however-- I'm a little fuzzy on how to pass the parameters to the command object using code. Do you (or anybody out there) know how to do this using ADO/DED recordset?

  4. #4
    Addicted Member
    Join Date
    May 2000
    Posts
    188
    To pass parameters to your command through code works like this

    DataEnvironment1.Command1 parm1, parm2, parm3

    etc...

    Let me know if it works or not or if you need more help.

  5. #5

    Thread Starter
    Addicted Member P.S.W.'s Avatar
    Join Date
    Aug 2000
    Posts
    146
    Nathan,

    You da man!! It works great! Thanks, pal .

    I only have one more question (I know, I ask too much!)

    My code now looks like this:

    DataEnvironment1.Command1 StartDate, EndDate
    Report1.Visible = True

    Which now works perfectly --except-- when I try to run this same procedure a second time, it gives me Error 3705 "Operation requested not allowed if object is open"

    So clearly, I have to somehow close or reset the command before trying to create another report with it. I've been fooling around with the closing the recordset and some other stuff, but so far everything I've tried causes only more errors . Any ideas on the proper way to do this? Thanks again for your previous replies.




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