Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Crystal Report Viewer always asks for login details to Access database on WePOS operating system?

I wrote a report using Crystal Reports XI linked to an Access database here C:\MyData.mdb.

The report has one field (simplified for this example) and no sub-reports.

I have used the Forms and WPF Cyrtsal Report Viewer using C# .NET 4.

The report views successfully on my development PC running Windows XP, and on other "tills", also running Windows XP.

However, on a till running WePOS (a sort of cut down Windows XP) the report "always" shows a dialog box asking for login details i.e. Username & Password.

This dialog box also shows the correct path to C:\MyData.mdb.

I have spent many days on this, testing in every way possible (I'm sure everyone remembers times like these!).

I use this code to ensure the database is correctly linked to:

TableLogOnInfo logonInfo;

foreach (CrystalDecisions.CrystalReports.Engine.Table table in report.Database.Tables)
{
    logonInfo = table.LogOnInfo;
    logonInfo.ConnectionInfo.ServerName = string.Empty;
    logonInfo.ConnectionInfo.DatabaseName = "C:\MyData.mdb";
    logonInfo.ConnectionInfo.UserID = string.Empty;
    logonInfo.ConnectionInfo.Password = string.Empty;
    table.ApplyLogOnInfo(logonInfo);
}

... and it works on every PC with Windows XP, except the one with WePOS.

I've also played with:

report.SetDatabaseLogon(string.Empty, string.Empty, "C:\MyData.mdb", string.Empty);

... but It makes no difference.

  1. There is no username or password on the Access database
  2. All the PC's used have the releveant software installed (runtimes, etc.)
  3. All the PC's were tested using the Adminstrator account (and file permissions were double checked)
  4. I've tried ticking the Integrated Security tick box, with no luck
  5. I set logonInfo.ConnectionInfo.DatabaseName = string.Empty;
  6. I set logonInfo.ConnectionInfo.ServerName = "C:\MyData.mdb";
  7. I have tried NOT using any of the above code, instead just made sure the database was in the same place on all PC's, with no luck
  8. It is an Access 2003 database file

I can only conclude WePOS is so "cut down" that Crystal is silently failing to pass authentication... please help!

like image 563
Adam Avatar asked May 24 '11 15:05

Adam


People also ask

Does Microsoft own Crystal Reports?

Crystal Reports is a popular Windows-based report writer solution that allows a developer to create reports and dashboards from a variety of data sources with a minimum of code to write. Crystal Reports is owned and developed by SAP.


2 Answers

Just for future reference, if you ever switch to SQL Server you will want to use SQL OLEDB and NOT the native Sql Client or you will run into the same problem again as I also did when I was first integrating CR into our app. It will work fine on your development machine but not in production.

like image 187
Brandon Moore Avatar answered Sep 28 '22 07:09

Brandon Moore


DOes this WePos thing have the correct right to read from to folder/location in your filesystem or do you need elevated rights or something to read from this location. Could be the same issue when you connect to a remote network folder. Then you also have to specify the credentials on that computer to get access to it. Does this make sense?

like image 20
Marco Avatar answered Sep 28 '22 07:09

Marco