cancel
Showing results for 
Search instead for 
Did you mean: 

Set Database Location update not "taking" Crystal 2013/SAP ASE 15.7

Former Member
0 Kudos

I developed my reports against a development database. The reports are "executed"  by a C# program that provides database login credentials for ASE 15.7 database.  When I went to install reports into production they failed with a "Failed to retrieve data from database" exception. The C# program provided the correct login credentials for the production server.  So, I said, let me try to connect to the prod server in the designer.  Using the "Database Expert" I created a new connection to the prod server.  No problem.  I use the "Set Database Location" dialog to switch the report source(s); main and sub-reports. I refresh the report and it says "Failed to retrieve data from database" then "Database Connector Error: "Attempt to location entry in sysdatabases for database 'test3' by name failed - no entry found under that name....  Its like it logged into the prod server, but tried to use the test server's database name.  In the "Database Expert"  the database name is correct.  How do I diagnose this? Is there problem changing the database name?

Thanks,

John

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hi John

I suspect your conclusion is correct. So the question would be once it logged into the server, why can it not access the database. I belie that the issue will be permissions.

Can you create a brand new report on the database that gives the error when you try to point to it in the existing report?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Former Member
0 Kudos

Ludek,

If I use the designer to change the "data source location" (and save the report) the report works against any of my databases.  When I change login credentials to a database different from the one last specified in the designer, it fails to connect.  I has tried to change credentials both by using SetDatabaseLogon() or directly changing the report object using the method below.  When examining the object  in the debugger, I haven't been able to detect the difference between when it actually connects and when it fails.  Obviously there is a difference.  Are you supposed to be able to switch databases programatically?  Or is crystal designed to only connect to the database that is last specified in the designer?  What am I missing?  Please help!

Thanks,

John

private void setLoginCreds(ReportDocument rpt, string dbServer, string db, string uid, string pw )

{

  Database crDatabase = rpt.Database;

  Tables crTables = crDatabase.Tables;

  foreach (CrystalDecisions.CrystalReports.Engine.Table aTable in crTables)

  {

  TableLogOnInfo crTableLogOnInfo = aTable.LogOnInfo;

  crTableLogOnInfo.ConnectionInfo.ServerName = dbServer;

  crTableLogOnInfo.ConnectionInfo.DatabaseName = db;

  crTableLogOnInfo.ConnectionInfo.UserID = uid;

  crTableLogOnInfo.ConnectionInfo.Password = pw;

  aTable.ApplyLogOnInfo(crTableLogOnInfo);

  //bool b = aTable.TestConnectivity();

  }

  Sections crSections = rpt.ReportDefinition.Sections;

  foreach (Section crSection in crSections)

  {

  ReportObjects crReportObjects = crSection.ReportObjects;

  //loop through all the report objects in there to find all subreports

  foreach (ReportObject crReportObject in crReportObjects)

  {

  if (crReportObject.Kind == ReportObjectKind.SubreportObject)

  {

  SubreportObject crSubreportObject = (SubreportObject)crReportObject;

  ReportDocument crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);

  setLoginCreds(crSubreportDocument, dbServer, db, uid, pw );

  }

  }

  }

}

former_member183750
Active Contributor
0 Kudos

Hi John

Yes, changing databases programmatically is a run of the mill thing...

I always recommend doing this in baby steps if it does not work initially;

Try a new test report, one table one field. No subreports. Does that work? If it does, have a closer look at the report you actually want to work with; Remove the subreport(s), try to run the report now. If that works, save out the subreport and try to run it on it's own. Does that work? If not, double check the connection type.

There is also a utility that you could use that will write out the code for you. See KBA 1553921 - Is there a utility that would help in writing database logon code?

- Ludek

Former Member
0 Kudos

Ludek,

Thank you for your reply. 

I have written a super-simple report against a single table a no sub-reports. I get the same exact behavior as the other reports.  Is there some nuance when using SAP ASE?

I tried the utility. It crashes on my reports, even my super simple report.  What are "QE_LogonProperties"? They don’t in my report.

  Dim boMainPropertyBag As PropertyBag = crCi.Attributes

  Dim boInnerPropertyBag As PropertyBag = boMainPropertyBag.Item("QE_LogonProperties")   No "QE_LogonProperties”

  Dim propIDs As Strings

  propIDs = boInnerPropertyBag.PropertyIDs   Crashes here

System.NullReferenceException was unhandled

  Message=Object reference not set to an instance of an object.

  Source=CodeBuilder-RasConnectionInfo

  StackTrace:

       at CodeBuilder_RasConnectionInfo.frmRasConnectionInfo.VBConnectionCode(ReportDocument boReportDocument) in C:\Crystal\CodeBuilder-RasConnectionInfo (NET2010 CRVS2010)\CodeBuilder-RasConnectionInfo (NET2010 CRVS2010)\Form1.vb:line 103

       at CodeBuilder_RasConnectionInfo.frmRasConnectionInfo.btnLoadReport_Click(Object sender, EventArgs e) in C:\Crystal\CodeBuilder-RasConnectionInfo (NET2010 CRVS2010)\CodeBuilder-RasConnectionInfo (NET2010 CRVS2010)\Form1.vb:line 16

       at System.Windows.Forms.Control.OnClick(EventArgs e)

       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

       at System.Windows.Forms.Control.WndProc(Message& m)

       at System.Windows.Forms.ButtonBase.WndProc(Message& m)

       at System.Windows.Forms.Button.WndProc(Message& m)

       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

       at CodeBuilder_RasConnectionInfo.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81

       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Th

former_member183750
Active Contributor
0 Kudos

Hi John

I think this may be telling:

I tried the utility. It crashes on my reports,

I've almost never heard of that utility "crashing". Are you able to attach one of the reports - no subreports please. Rename the rpt to txt, and attach in "use advanced editor".

- Ludek

Former Member
0 Kudos

Ludek,

Thank you for the reply.  Please find attached the "simple" report that I mentioned my last post.  (Extension changed to "txt")  

John

former_member183750
Active Contributor
0 Kudos

Hi John

So, looking at the report more closely, I see that it is using the crdb_p2ssyb10.dll to connect to the database. What version is this dll on your system?

- Ludek

Former Member
0 Kudos

File properties->details says version is 14.1.1.1036

former_member183750
Active Contributor
0 Kudos

Ok that is good for the CR 2013 designer and maybe for the app; What is the version of the CR Assemblies referenced in your project?

Also, is the app compiled as 32 bit or 64 bit?

- Ludek

Former Member
0 Kudos

CrystalDecisions.CrystalReports.Engine 13.0.2000.0

CrystalDecisions.Shared 13.0.2000.0

The production app is 32 bit.  I have tried 32 & 64 and "Any CPU"  with the "simple" report/test app.

former_member183750
Active Contributor
0 Kudos

Now, with those assemblies, the version of the crdb_p2ssyb10.dll, should be 13.x. The files for CRVS are in this directory:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86

Can you check that the file is there and let me know the version of it?

- Ludek

Former Member
0 Kudos

Yes,

This file is present:

"C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crdb_p2ssyb10.dll"

Version: 13.0.9.1312

Former Member
0 Kudos

Ludek, Does the "RAS Connection" work for you with that report?  That utility would be helpful.

former_member183750
Active Contributor
0 Kudos

Unfortunately no it does not work. I get an error and the report is never parsed. A faint hope;

Looking at the version (13.0.9.1312) tells me that we're working with SP 9. SP 14 released last week. Can you please update the install to SP 14? The download links are in the following doc:

Make sure to use the install exe, not the MSI file.

- Ludek

Former Member
0 Kudos

SP 14 is no help.  Same results.

Now using CrystalDecisions.CrystalReports.Engine & CrystalDecisions.Shared version 13.0.2000.0

former_member183750
Active Contributor
0 Kudos

13.0.2000.0 is the assembly version. This does not change from SP to SP, only file version changes. it should be 13.0.14.x

I think we're at a point though, where a phone incident may be warranted. If you have access to the SAP Service Market Place, please create it there. If not, give sales a call:

866-681-3435 or 1-800-677-7271

Worldwide Office Locations | SAP

- Ludek

Former Member
0 Kudos

Thanks Ludek, .  I will open a phone incident tomorrow morning.

John