Print Page | Close Window

Failed Logon in vb 2003 web site

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=234
Printed Date: 02 May 2025 at 12:20pm


Topic: Failed Logon in vb 2003 web site
Posted By: jbeale
Subject: Failed Logon in vb 2003 web site
Date Posted: 21 Feb 2007 at 9:01pm

When I  connected to the Xtreme Database, it works. When I try to use my SQL Server database, I get the following error. I also get funny data in the preview.

Server Error in '/WebApplication5' Application.


Logon failed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[LogOnException: Logon failed.]
   .I(String , EngineExceptionErrorID ) +506
   .D(Int16 , Int32 ) +537
   CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +539
   CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
   CrystalDecisions.Web.ReportAgent.u(Boolean n) +164
   CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +62
   System.Web.UI.Control.PreRenderRecursiveInternal() +125
   System.Web.UI.Control.PreRenderRecursiveInternal() +125
   System.Web.UI.Page.ProcessRequestMain() +1499




Replies:
Posted By: BrianBischof
Date Posted: 21 Feb 2007 at 11:54pm
You can't use the same code for opening a MS Access database to open a SQL Server database. People read my book and in the first example I show how to open an MS Access database with Crystal Reports and it works fine. Then they try to swap out the database name for SQL Server and it crashes. The code to login in to SQL Server is more complicated. You have to set the UserId and Password properties of the ConnectionInfo class. Then add this to the table by calling the method ApplyLogonInfo().

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: jbeale
Date Posted: 22 Feb 2007 at 10:18am
Brian thanks for the quick repsonse! I like your book, some of it is over my head. I have read chapters 13 and 17 in your book, but I am confussed.
 
I feel the Pull model will work for me, but I do not know where to enter the UserID and Password or where to put the ApplyLogonInfo().
 
Can you give me detail instructions for a simple example to connect to a MS SQL database named "dbquote", a single table named " tbCustomer" , user="jim51", password ="xyz3412". I assume the database parameters are stored in the application once they are selected and it is only the userid and password that I am missing. Not sure!
 
 
I have no problems selecting the server, database, tables and fields. In the preview mode it all looks great. I just don't know how to pass the logon info in the web application, to get past the LOGON Failed.
 
Thank you for your help. I have spent a lot of time on this and I feel I am really close!
 
 



Print Page | Close Window