Results 1 to 10 of 10

Thread: problem with DataReport and DataEnvironment

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Talking problem with DataReport and DataEnvironment

    Hi,
    I have a DataEnvironment and a DataReport in my Visual Basic project, in which I am using Access database. When I produce the report, during run-time, and when I close the report, and try to execute another SQL query to produce a second report I get an error, that the object (my DataReport) cannot stay open...

    the run-time error that appears is :

    "Run-time error 3705: Operation is not allowed when the object is open"

    And when I press "Debug" the error is located in line:
    DataEnvironement1.Command1 mystr1
    at the object DataEnvironment

    Can someone pls pls help ???
    or if you know a DataReport , DataEnvironment tutorial, can someone please send me the link?
    thank you, so much !!!

  2. #2
    Junior Member
    Join Date
    Mar 2006
    Posts
    16

    Re: problem with DataReport and DataEnvironment

    try to close ur objects
    like

    rs.close
    set rs=nothing

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

    Re: problem with DataReport and DataEnvironment


  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: problem with DataReport and DataEnvironment

    what is rs?

  5. #5
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: problem with DataReport and DataEnvironment

    Hi,

    rs stands for recordset...It is an object used for retrieving values from tables in a database...

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  6. #6
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: problem with DataReport and DataEnvironment

    what the above posts are talking is about the use of ado connection and recordsets.

    i strongly suggest that you stop using data environment and migrate to using ado for more flexibility and lesser problems with your system.

    check out beacons ado tutorial here

    http://vbforums.com/showthread.php?t=337051
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: problem with DataReport and DataEnvironment

    But I tried to go with ADO before and it was not working.. so I found a tutorial explaining step-by-step how to use DataEnvironment and Commands ...and so I did it with this...

    The problem remains; I cannot produce more than once a report....

    Can anyone please help me?

  8. #8
    Addicted Member
    Join Date
    Feb 2006
    Posts
    208

    Re: problem with DataReport and DataEnvironment

    try this.. i hope it could help.

    VB Code:
    1. On Error Resume Next
    2. dataenviroment1.rsCommand.close
    3. dataenvironment1.command mystr
    4. On Error Goto 0
    5.  
    6. myreport.show

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: problem with DataReport and DataEnvironment

    My problem is solved with this!!!
    thank you very much Alexis23 !!!!

  10. #10
    New Member
    Join Date
    Aug 2006
    Posts
    1

    Re: problem with DataReport and DataEnvironment

    Try this in frm DataReport

    Private Sub DataReport_Terminate()
    DataEnvironment1.rsRecordset.Close
    End Sub

    change "rsRecordset" for your app

    I´m sorry but my English is bad
    I'm only try help you ...

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