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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change the DB location at runtime?

Status
Not open for further replies.

aplusc

Programmer
Feb 17, 2002
44
US
In Visual Basic?
 
to change crystl report DB at run-time use
use the following method
Report.Database.LogOnServer &quot;P2SODBC.DLL.dll&quot;, <Your Server Name>, <Your Databas Name>, <UserID>, <Password>

the method works with ODBC i know there is a bug in crystal report when u want to do with OLE DB...guessed crystal reports also have bugs :)
Regards
Nouman
 
Dear
use this
'Database Setting For Main Report
For intTables = 1 To ReportObject.Database.Tables.Count
ReportObject.Database.Tables(intTables).Location = ReportDatabaseName & &quot;.dbo.Proc(stp_ORD_GetOrderItemsByOrderID;1)&quot;
ReportObject.Database.Tables(intTables).SetLogOnInfo ReportServerName, ReportDatabaseName, UserName, Password
Next intTables

Regards
Nouman
 
If you are using the activex control then you can set the
crystalreport1.datafiles(x)= DB path
x is a base 0 value and use as many datafile statements as there are database tables
 
Mike,

How does it work when we have a subreport also? Or how do we set the location for subreports programmatically?

 
ActiveX control OCX in CR 8.5
there is an error when i do packaging of project.
the deployment and package wizard program terminated.
What is the problem?
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top