🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #231

Strange crystal reports problem with BDS 2006.

#231
From: Liam Mullane
Date: Thu, 12 Jul 2007 08:57
48 lines
2511 bytes
Hi All,

I have a small standalone form. Which runs a simple crystal report.
It uses the following components

IReport *Report1;
TApp *App1;
TADOQuery *ADOQuery1;
TADOConnection *ADOConnection1;

This runs fine on its own.

The problem is when I import it into a larger project then I get an Access
Violation when exiting the program but only while running through the IDE.
If this larger application is run outside the IDE there is no problem.

The code is below. The funny thing is if I comment out the
Report1->Database->SetDataSource function it gives no error (but the report
is blank).

Any Ideas?

Second Question: What is the best way to pass a TDataset into Crystal
Reports?


App1 = new TApp(Application);
ADOQuery1 = new TADOQuery(this);
ADOConnection1 = new TADOConnection(this);
ADOConnection1->ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Program Files\\Dairymaster\\DmmWin\\Data;Extended
Properties=Paradox 7.X;Persist Security Info=False";
ADOConnection1->Provider = "Microsoft.Jet.OLEDB.4.0";
ADOQuery1->Connection = ADOConnection1;
ADOConnection1->LoginPrompt = false;
ADOConnection1->Connected = True;


Variant tag;
tag = crOpenReportByDefault;
Report1 = App1->OpenReport(WideString(RepName),tag);
ADOQuery1->SQL->Text = "Select * from customers";
ADOQuery1->Active = true;
Report1->Database->SetDataSource((Variant)ADOQuery1->Recordset,(Variant)3,(V
ariant)1);
CrystalActiveXReportViewer1->ReportSource = Report1;
CrystalActiveXReportViewer1->Enabled = true;
CrystalActiveXReportViewer1->ViewReport();
Technical Details
Message-ID: <4695ed17$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,91a11c5ae9fb725e,start
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Liam Mullane" <STOPSPAM.lmullane@dairymaster.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Strange crystal reports problem with BDS 2006.
Date: Thu, 12 Jul 2007 09:57:11 +0100
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: 193.120.239.74
Message-ID: <4695ed17$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1184230679 193.120.239.74 (12 Jul 2007 01:57:59 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 2369