Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DSN Connectivity with Crystal Report
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
DSN Connectivity with Crystal Report
Miscellaneous
Thread ID:
00669789
Message ID:
00669789
Views:
46
Hi Craig,

I am getting the error "File access denied" while using the same DBF name in the form. I have one simple form with a PREVIEW button. The code in the Click method of PREVIEW button is:
select * from pvendor into dbf temp1
USE
DO FORM PrintSelection WITH "myreport.RPT","temp1"
Now in the INIT method of form "PrintSelection" has following code:
PARAMETER cRep, cData
tReport = sys(5)+sys(2003)+"\"+cRep
tFILE1  = sys(5)+sys(2003)+"\"+cData

WITH This
      .oCrystalReports = CREATEOBJECT("CrystalRuntime.Application")
      .oReport = .ocrystalreports.OpenReport(tReport)
      .AddObject("oleCRViewer", "oleControl", "crViewer.crViewer")      
ENDWITH

crdata = ThisForm.oReport.Database
crtables = crdata.tables
crtables.item(1).name = cDATA
crtables.item(1).location = tFILE1
crparm = ThisForm.oReport.parameterFields
crparm.item(1).setcurrentvalue(cCutDate)

WITH This.oleCRViewer
	.Top = 1
	.Left = 1
	.Height = ThisForm.Height - 2
	.Width = ThisForm.Width - 2
	.ReportSource = ThisForm.oReport
	.ViewReport()
ENDWITH
This runs fine first time, but when I click the preview button second time I gets the error at SELECT line that "File access is denied"

I am using private Datasession in both the forms.

I don't know what is wrong here? Please help me sorting this problem.


Thanks

Pramod
Next
Reply
Map
View

Click here to load this message in the networking platform