Another Logon Failed err...

R

Rey

Howdy all.

Using VSNet 2003 on an XP Pro SP2 boox. Trying to use Crystal Reports
to access an mdb file with access security/workspace.

Simple report of customers but after spending mucho time researching -
but still not knowing why/what caused it -a load report failed err,
read some articles and this problem was resolved.
Now I have a logon failed err. Code below was modified for C# from
article in dotnetjunkies "Creating Reports using Crystal Reports for
Visual Studio .NET."

Appreciate any suggestions/comments on how to resolve this err and
finally display the simple report.

Below is the code used to display report. The rem'ed VB code is from
the article.

Thank you,
Rey

*******************

protected CrystalDecisions.Web.CrystalReportViewer
CrystalReportViewer1;
//CrystalDecisions.CrystalReports.Engine.Table myTable;
//CrystalDecisions.Shared.TableLogOnInfo myLogin;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// in order to not receive a logon failed err msg
// need to use following code to incl the 2 lines above
rptTest rpt = new rptTest(); // var of rpt
// CrystalDecisions.CrystalReports.Engine.Table myTable;
CrystalDecisions.Shared.TableLogOnInfo myLogin;

foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in
rpt.Database.Tables)
{
myLogin = myTable.LogOnInfo;
myLogin.ConnectionInfo.Password = "12345";
myLogin.ConnectionInfo.UserID = "aUser";
myTable.ApplyLogOnInfo (myLogin);

}

CrystalReportViewer1.ReportSource = rpt;
this.DataBind();
}
}
/*

Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
crpt = New CrystalReport1()

For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "test"
myLogin.ConnectionInfo.UserID = "sa"
myTable.ApplyLogOnInfo(myLogin)
Next

CrystalReportViewer1.ReportSource = crpt
*/
 
O

Octavio Hernandez

Hola Rey,

- Check these documents in the BusinessObjects Knowledge Base:

http://support.businessobjects.com/...rt+failed&content_typ=all_support&language=EN

- Take a look at the ReportDocument.SetDatabaseLogon() method, you could do
with only one line of code what now is taking you several.

Regards - Octavio

// CrystalDecisions.CrystalReports.Engine.Table myTable;
CrystalDecisions.Shared.TableLogOnInfo myLogin;

foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in
rpt.Database.Tables)
{
myLogin = myTable.LogOnInfo;
myLogin.ConnectionInfo.Password = "12345";
myLogin.ConnectionInfo.UserID = "aUser";
myTable.ApplyLogOnInfo (myLogin);
 
R

Rey

Buenas, Octavio.

Thanks for the tip.
Was able to get logged on when I changed the machine.config file as a
test. Reset it back, stopped, restarted and even rebooted and was then
able to access the mdb w/a quickie rpt...

Now when I attempt to do same but using the push meth via a dataset, I
now get "Not a valid account name or password" msg. And this is with
your tip and setting same for each tbl of which there is only one being
used in the rpt.

CR is leaving a bad taste in my mouth...

Gracias for the tip.

Rey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top