Urgent:SQL db change dynamicaly for Crystal VC.NET
Hi, I am using crystal 8.0 in VC.NET using the craxdrt.dll.
I want to connect to different database server and difeerent database name at runtime. I have written follwoing code :
/////
IApplicationPtr pApp;
IReportPtr rpt;
pApp.CreateInstance("CrystalRuntime.Application");
rpt = pApp->OpenReport(CString("d:\\report1.rpt").AllocSysStr ing());
pApp->LogOnServer((_bstr_t)"p2ssql.dll", "abum", "northwind", "jhasuman", "sumanjha3");
m_crviewer.put_ReportSource(rpt);
m_crviewer.ViewReport();
///////
but it gives error "Server has not yet been opened". Need any help urgently
|