Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't print report due to "Access to report file denied." message 1

Status
Not open for further replies.

ITdev

Programmer
Aug 6, 2001
25
US
Hi,
I am using Crystal Reports 8.0 which directly connects to Access 2000. I am opening the report through visual basic 6.0, Crystal Reports Control(crystl32.ocx).

The program I am working on requires multiple of reports with different ranges. In the begining the report preview worked fine and after about 20 something previews, I can't get any report preview to open up. Instead i got a runtime error 20544.
"Access to report file denied. Another program may be using it."
I know that another program isn't using it except for the one I am using. The report sits on the server and VB program is on the client end. I am stump. When I hit debug from VB it highlight CrystalReport1.action = 1

Here's my code from VB
CrystalReport1.ReportFileName = "F:\Report\Test.rpt;true;"
CrystalReport1.ParameterFields(0) = "strSQL;" & strRange
CrystalReport1.ParameterFields(1) = "Sortby;" & strSort
CrystalReport1.ReplaceSelectionFormula (strRange)
CrystalReport1.Action = 1

I've tried logging off the network, reboot, refresh the report and so far nothing works. I've had this problem for a week and the error is still there.

I've checked with seagate support and found this article

I tried to create a temporary copy and when I use
Dim crpReport as Crpeaute.Report
Dim crpApplication as New Crpeauto.Application

I didn't get intellisence from VB so I know I must be missing something but don't know what.

I appreicate any help. Thanks in advance.
 
Are you saying that after you reboot, you can't run the report from the application at all? What if you open the report in the report designer, save it under another name and try that report? Or, if that doesn't work, create a new simple report from scratch and try that one just to see if it is the report or the code. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thank you for your response Mr. Hamady
After I rebooted, I still got error 20544 from the application. :-( I have tried to open the report and save it under another name and created a fresh report (after I read your suggestions) but I still got the error. So I figured it can't be a crystal report error.

However, when I delete ";true;" from the ReportFileName I didn't get the error anymore.
from [tt]CrystalReport1.ReportFileName = "F:\Report\Test.rpt;true;"[/tt] to [tt]CrystalReport1.ReportFileName = "F:\Report\Test.rpt"[/tt]

I suppose the user will have to deal with the paramater view before going to the print preview. At least for now until I can find another alternative.
 
OOPS! I missed the problem completely.
That word TRUE should never have been on that line. It is not a valid argument on that command. You put the TRUE on the end of the Parameter commands, not the the file name command. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
OMG! I didn't realize until I read your last response that I had been putting TRUE at the end of the filename instead of the parameter. All that work and it never occured to me. It was right in front of my face all this time.

Aughhhhhhh! I feel so.. duh

Thank you so much Mr. Hamady, you have been a tremendous help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top