Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DSN Connectivity with Crystal Report
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00669789
Message ID:
00669791
Vues:
12
A couple of ideas:

- Make sure the preview form is getting released
- Make sure the tables are erased before doing the SELECT a second time


>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
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform