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 !!!
Re: problem with DataReport and DataEnvironment
try to close ur objects
like
rs.close
set rs=nothing
Re: problem with DataReport and DataEnvironment
Re: problem with DataReport and DataEnvironment
Re: problem with DataReport and DataEnvironment
Hi,
rs stands for recordset...It is an object used for retrieving values from tables in a database...
:) :) :)
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
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?
Re: problem with DataReport and DataEnvironment
try this.. i hope it could help.
VB Code:
On Error Resume Next
dataenviroment1.rsCommand.close
dataenvironment1.command mystr
On Error Goto 0
myreport.show
Re: problem with DataReport and DataEnvironment
My problem is solved with this!!!
thank you very much Alexis23 !!!!
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 ...