🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages Started by Liam Mullane Thu, 12 Jul 2007 08:57
Strange crystal reports problem with BDS 2006.
#231
Author: 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();
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads