Unlocking Crystal Reports - vb6
-
I run multiple instances of a vb6 app from desktop PCs. The apps run crystal reports (v8). The .rpt files are on a shared folder. Problem is, if the folder allows 8 connections, running reports 9times leads to a no-access error (see below). It seems setting the report and application objects to nothing does not unlock the report. Users have to unlock it in Admin Tools\Comp Mnagement\Shared Folders\Open Folders. Exiting the app also unlocks the reports. How can I unlock a report after using it in code? Error occurs at line Dim crystalreport As New Report Dim crystalApplication As New Application .. Set crystalreport = crystalApplication.OpenReport(strReportPathName) The error is: 'Error in File UNKNOWN.RPT: Access to report file denied. Another program may be using it' :rose::rose: 1fm1fu
-
I run multiple instances of a vb6 app from desktop PCs. The apps run crystal reports (v8). The .rpt files are on a shared folder. Problem is, if the folder allows 8 connections, running reports 9times leads to a no-access error (see below). It seems setting the report and application objects to nothing does not unlock the report. Users have to unlock it in Admin Tools\Comp Mnagement\Shared Folders\Open Folders. Exiting the app also unlocks the reports. How can I unlock a report after using it in code? Error occurs at line Dim crystalreport As New Report Dim crystalApplication As New Application .. Set crystalreport = crystalApplication.OpenReport(strReportPathName) The error is: 'Error in File UNKNOWN.RPT: Access to report file denied. Another program may be using it' :rose::rose: 1fm1fu
It would appear that the underlying file handles to open and read the report in the OpenReport method are not being released when you drop the objects out of scope. I can't remember the old version of Crystal Reports objects, but is there a Close method to go along with the OpenReport method on the Application object? You might want to try that and if it doesn't exist, try visiting BuisnessObjects.com and see if there is an update to the Crystal Reports package your using. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
I run multiple instances of a vb6 app from desktop PCs. The apps run crystal reports (v8). The .rpt files are on a shared folder. Problem is, if the folder allows 8 connections, running reports 9times leads to a no-access error (see below). It seems setting the report and application objects to nothing does not unlock the report. Users have to unlock it in Admin Tools\Comp Mnagement\Shared Folders\Open Folders. Exiting the app also unlocks the reports. How can I unlock a report after using it in code? Error occurs at line Dim crystalreport As New Report Dim crystalApplication As New Application .. Set crystalreport = crystalApplication.OpenReport(strReportPathName) The error is: 'Error in File UNKNOWN.RPT: Access to report file denied. Another program may be using it' :rose::rose: 1fm1fu
also, to add to what dave mentioned... i don't recall if it existed in the older crystal libraries, but i know that it does in cr.net & cr 9. when you open your report you have the option of how you wish to open that report: OpenReportByDefault or OpenReportByTempCopy Open report by temp copy actually makes a temporary copy in the same folder as the original report template. then uses this temporary copy rather than the original allowing it to be accessed by other processes... which will hopefully also open by temp copy. again, not sure if it will be available to you from the com version of the libraries, but if not you can always check out the possibility of creating a com wrapper of the crystal .net assemblies if you think this option is worth checking out. hope this helps.
-jim
-
also, to add to what dave mentioned... i don't recall if it existed in the older crystal libraries, but i know that it does in cr.net & cr 9. when you open your report you have the option of how you wish to open that report: OpenReportByDefault or OpenReportByTempCopy Open report by temp copy actually makes a temporary copy in the same folder as the original report template. then uses this temporary copy rather than the original allowing it to be accessed by other processes... which will hopefully also open by temp copy. again, not sure if it will be available to you from the com version of the libraries, but if not you can always check out the possibility of creating a com wrapper of the crystal .net assemblies if you think this option is worth checking out. hope this helps.
-jim
Thanx Dave n jmatthew. Appears if i pass the OpenMethod optional parameter a 1 in OpenReport method i can open multiple instances. There is no close method for the Crystal Application class though. I'll do with the workaround for now... :rose::rose: 1fm1fu