
Logon Failed For Crystal Reports
NO solution, but the same problem.
In my case it is actually between 2 different users against the same DB.
I suspect it has to do with the DSN of a subreport, but I'm not sure.
Perhaps the logon info does not propogate to a sub-report? The report
document only lists a single table although I know at least one subreport is
different.
I cirumvented it by rewriting the report to go aginst a dataset. Much
quicker since my applicationa ctually prints about 15,000 reports off the
same set of data. Query once (which now runs a few minutes), and then never
again (reports generate for a few hours after that).
Quote:
> I'm wondering if anyone else has had this problem.
> When I run a crystal report and connect through ODBC to SQL Server 2000 on
> my development machine I do not have a problem. I also dont have a
problem
> when I installed it on a few other machines.
> Yet there are others that prompt for the database login and pw when the
> report loads. When I type it in it says "Logon Failed" and will do this
> over and over again.
> Some guy at Seagate told me to pass the logon info when it loads... Ok so
I
> did that using the code below, it was no help. Anyone else have a
different
> take on this? This is all in C#....
> private void SetConnectionInfo (string table, string server, string
> database, string user, string password)
> {
> // Get the ConnectionInfo Object.
> TableLogOnInfo logOnInfo = new TableLogOnInfo();
> logOnInfo = crReportDocument.Database.Tables[table].LogOnInfo;
> ConnectionInfo connectionInfo = new ConnectionInfo ();
> connectionInfo = logOnInfo.ConnectionInfo;
> // Set the Connection parameters.
> connectionInfo.DatabaseName = database;
> connectionInfo.ServerName = server;
> connectionInfo.Password = password;
> connectionInfo.UserID = user;
> crReportDocument.Database.Tables [table].ApplyLogOnInfo(logOnInfo);
> }