Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Application roles problem VB6, CR9

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

Tags:

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question