Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 9 RDC / PB8 Changing DB Connection

Status
Not open for further replies.

DixieNormous

Programmer
Jan 27, 2003
3
US
I have added the Crystal Reports Viewer as an OLE control to my PowerBuilder 8.0.2 application. We have several reports that were created while connecting to identical Oracle / Microsoft SQL 2000 databases. I am trying to change the connection information for the report so that it connects to the same database that my application is connecting to.
 
I am using Crystal Reports 9 Developer Edition and PowerBuilder 8.0.2. I would like to connect native to Oracle and OLE to MSSQL 2000. Here is my code so far:

treeviewitem ltvi_item
long lRet
string l_docname
oleobject oleCrystal,oleReport
oleCrystal = CREATE oleobject
oleReport = CREATE oleobject

this.GetItem(handle,ltvi_item)

//MessageBox(Trim(ltvi_item.label),Trim(ltvi_item.data)+Trim(ltvi_item.label))

lRet = oleCrystal.connecttonewobject("CrystalRuntime.Application")
//lRet = oleReport.connecttonewobject("CrystalRuntime.Report")
// You'll want to check that Ret = 0 (NO ERROR THERE)
l_docname = Trim(ltvi_item.data)+Trim(ltvi_item.label)

oleReport = oleCrystal.openreport(l_docname, 1)

// I am having trouble here with PowerBuilder
//oleReport.Database.Tables[1].ConnectionProperties.item.server = sqlca.ServerName
//oleReport.Database.Tables(1).ConnectionProperties.user_id = sqlca.logid
//oleReport.Database.Tables(1).ConnectionProperties.item = sqlca.logpass


ole_crystal_report_viewer.object.reportsource = oleReport
ole_crystal_report_viewer.object.viewreport()
 
I have crystal report that I would like to run on different databases in ORACLE, with the user selecting which database supplies the data for the report (the tables are
the same in each database).

I have successfully done this with a single database using the RDC combined with the LogOnServer method.

Pls give me the solution for multiple database using native oracle database driver dll crdb_oracle.dll

Environment
-----------
Crystal Report 9
ORACLE 8i
Power Builder8.0
Windows NT
 
Can you send me the details of how you used the LogOnServer method? I have almost the same environment:

Crystal Report 9
ORACLE 8i and 9i
Power Builder8.0
Windows XP

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top