cancel
Showing results for 
Search instead for 
Did you mean: 

Application roles problem VB6, CR9

Former Member
0 Kudos

Hi All,

I've met a problem with supporting application written on VB6 that generate crystal reports(ver. 9).

I'm implementing windows authentication / application role approach in application.

I can open trusted connection for report but I can't set application role after report is open at runtime.

I have 100+ *.rpt files and I'm not allowed to modify them.

Also I can't use non trusted connection just for viewing reports.

AFAIK I can't modify SQLQuery at runtime.

I tried to read it using Report.SQLQueryString after opening report but there are no actual parameters.

1) Is there a way how to get this query with actual parameters from Report.ParameterFields?

2) Even if I get working SQL Query with filled parameters and get dataset using main connection will it be possible to feed dataset to report that already has his own SQLQueryString on runtime?

Or maybe there some other ways how to set application role at runtime?

Any help very appreciated

How it works now:

-----------------------------------------------------------------------------------------------------------

'defines, etc.

...

Set Report = Application.OpenReport(Path)

...

Dim crtable As CRAXDRT.DatabaseTable

For Each crtable In CrxReport.Database.Tables

Set ConnectionInfo = crtable.ConnectionProperties

ConnectionInfo.DeleteAll

ConnectionInfo.Add "Provider", "SQLOLEDB"

ConnectionInfo.Add "Data Source", gvODBC

ConnectionInfo.Add "OSAuthent", 1

ConnectionInfo.Add "Database", "MainDB"

Next

...

'Parameters

Report.ParameterFields.GetItemByName("Param1").AddCurrentValue (1)

...

Report.ReadRecords

CRViewer91.ReportSource = Report

CRViewer91.ViewReport

-----------------------------------------------------------------------------------------------------------


Thanks,

Taras

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Taras

You're working with a version of CR that was retired about a decade ago. Additionally, this version does not support any of the current Operating Systems. Finally, support of any recent databases is also not there. My suggestion would be to move on to Visual Studio .NET and SAP Crystal Reports, Developer Version for Visual Studio .NET.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Answers (0)