Crystal11 and VB6 "logon failed"

jerrystefaniak
jerrystefaniak used Ask the Experts™
on
What I am trying to do is change a VB6/SQL program to use windows authentication. Everything works fine except the Crystal reports.  I went into each report and changed my connections from DSN to Windows Authentication.  I selected the server and the database.
The reports looks fine and displays fine in Crystal.  
The I tested the reports in my VB6 program.  I changed the associated variables to now use windows authentication.

When I tested the reports, they WORKED.
But then if I alter the report in any way, something happens and I get a "Logon Failed"

This is all happening on the same machine.

Why did it work the first time when I Initially changed to the windows authentication but then stops once any change is done to the report?

Let me know what other informatopn you may need.

Thank you,

Jerry

Here is the original DSN Login (Commented out) and the new Windows Authentication login
    For Each crxDataTable In crxReport.Database.Tables
'      crxDataTable.SetLogOnInfo gbServer, gbDatabase, gbUserID, gbPW
      crxDataTable.SetLogOnInfo gbDataServer, gbDatabase, "<<Use Integrated Security>>", vbNullString
 
      I = InStr(crxDataTable.Location, ".")
      If I = 0 Then
         crxDataTable.Location = gbDatabase & ".dbo." & crxDataTable.Location
      Else
         crxDataTable.Location = gbDatabase & Mid$(crxDataTable.Location, I)
      End If
 
      If Not crxDataTable.TestConnectivity Then
         sMsg = "Unable to connect to database."
         Set crxReport = Nothing
         Set crxApp = Nothing
         Exit Sub
      End If
    Next

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Did you reset the report to use WIndows authentication?

mlmcc
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What kind of chnages did you make?

mlmcc

Author

Commented:
Actually all I had to do was make the size of a reporting field bigger and save the change and then the report no longer logs in.

How do I make sure that windows Auth is set right?

I just noticed something.
When I open one of my reports and tell it to Verify Database, it comes up with the connection Information box with nothing filled in.  It's as if the original values are not being saved with the report?

I think I reset the report to use windows authentication.  Attached are pics.  Hope it helps.

I
Login-Failed-01.doc
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
It seems that whenever I go into Crystal the first time, the login fails.  After two or three attempts, then it takes and then subsequent reports open fine

Jerry
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Is it the same report that gives trouble or do all reports fail if tried first

mlmcc

Author

Commented:
It seems that it's all reports.  Any report that I change in any way seems to break the login routine.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
You may need to go into each report and use the SET DATABASE LOCATION under the DATABASE menu.  You then change the reports to use WIndows Authentication

mlmcc

Author

Commented:
I DID go into every report and set the database location.  Everything seemed to work fine until I  try to alter a report...When you say Windows Authentication do you mean that little checkbox that says ISS Security?  (I think that's what the box says.  I'm not at my computer to check)  Because each report had the location changed and that box was checked.

Let me know if there is something I have missed.  I hope so!  this is frustrating.

Thanks

Author

Commented:
Basically what I am seeing here is that whenevr I go back into a Crystal Report, I have to reenter the connection information.  I never saw this when I was using a DSN with a UserID and Password (for the past 10 years).  Now that our auditors want us to go to Windows Authentication, now I am being asked everytime for the connection.

Have I missed something??

Author

Commented:
Dear mlmcc:,
I want to give you more info hopefully it will help.

What I have also done is tried to uninstll Crystal 11 and Crystal 11 Rel 2.  I was able to remove Crystal 11 and reinstall but I cannot remove  Release 2.  I get a weird error message right at the end of the uninstall process.

Could this be a factor?

Thank you. . . . jerry
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
It could be but I doubt it.

We built a large project and used Windows Authentication or Integrated Security for the reports.  as I recall when I opened a report I had to give me logon and password but the users never reported a problem.  It has been too long ago to really remember.  

mlmcc

Author

Commented:
When I try to remove All Crystal 11 Releasae 2 I get a message "Error 1316: A network error occured while attempting to read from the file: C:\WINDOWS\Installer\CrystalReports.msi"

Is there anything I can do to remove Release 2?

Also, is there any more information I can give you to help me with this login problem?  I am totally stuck here and have no idea where to turn.

thank you.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I wonder if that file disappears when you uninstall CR XI R1.

Try setting th elocation before the logon

   For Each crxDataTable In crxReport.Database.Tables
      I = InStr(crxDataTable.Location, ".")
      If I = 0 Then
         crxDataTable.Location = gbDatabase & ".dbo." & crxDataTable.Location
      Else
         crxDataTable.Location = gbDatabase & Mid$(crxDataTable.Location, I)
      End If
'      crxDataTable.SetLogOnInfo gbServer, gbDatabase, gbUserID, gbPW
      crxDataTable.SetLogOnInfo gbDataServer, gbDatabase, "<<Use Integrated Security>>", vbNullString
 
mlmcc

Author

Commented:
1.  Originally I tried uninstalling Rel 2 first and got the same error.  Then I just uninstalled Rel 1 out of desperation.

2.  I tried your idea but I die on a login error as soon as it executes the crxDataTable.Location = gbDatabase & ".dbo." & crxDataTable.Location command.  I guess it requires a valid login in order to set its locations.

Jerry

Author

Commented:
I'm at my wits end here.  Do you have a operson maybe at Crystal that I could possibly contact.  I would be willing to let them use LogMeIn in order to get on my computer and see what's wrong.  I have no idea whether it's my computer, my set up or a bug somewhere.

Let me know if there is a contact.

Thank you,

Jerry
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
I don't know.  I don't have any contacts at Crystal

mlmcc

Author

Commented:
Dear mimcc,
Do you know how it feels when you've spent tons of time doing a job one way and then find there was a simpler way all along?  Well my problem is that I was using DSN's to link the reports to the system.  After I removed the DSN and changed all my reports to read from my server, I decided to see if the same problem would occur at my user's site.

Well, my reports would not work because they were linkd to my server at home - hard linked.  And I thought, "Oh hell, I'm going to have to change these reports everytime I move them to my user's system.  And then the light dawned.

All I had to do in order to get the reports to use windows Authentication was to change the DSN to use Windows Authentication.  Simple.

I don't know what was causing the original problem here but I don't care.  The reports are now using Windows Auth without haing to change a thing.

I'm going to give you the points anyway because you spent time trying to help.

Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial