cancel
Showing results for 
Search instead for 
Did you mean: 

Database Logon Error

Former Member
0 Kudos

Good Afternoon

I'm facing a problem with a report developed in VS.Net 2008 using crystal inside of the development studio. The reason for this is it uses a class as a design data source and then is populated at run time with a Generic List(List Of) of the class using the SetDataSource and then exported to Excel. All works swimmingly on my development pc however when we deploy this to a server it fails with the below error. We have the 2008 runtime installed correctly on the server so to some extent it should just work

Database logon failed.System.Runtime.InteropServices.COMException (0x8004100F): Database logon failed.ETC*

Below is a section of the VB.Net code, can you please advise how I get around this. There is effectively no connection to a database required but I am happy for anything that gets me past this.....

Thanks

Terry

Edited by: Don Williams on Apr 7, 2010 7:27 AM

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos
Dim lstMagstat As New List(Of clsMagstatDets)
        Dim magstatHelper As New clsMagstatDetsHelper
        Dim strFileLoc As String = strDefaultOutputLocation & pubprof.PublisherName & " Magstat " & Format(Date.Now, "yyMMdd") & ".xls"
        lstMagstat = magstatHelper.FetchMagstat(pubprof, strConn)

        Try
            Dim rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument

            If pubprof.DetailOrSummary = "Summary" Then
                If magstatHelper.FetchMagazineLevel(pubprof.MasterLevel) = "Magazine" Then
                    rpt = New rptSummaryMagazineMagstat
                Else
                    rpt = New rptSummaryMasterMagstat
                End If
            ElseIf pubprof.DetailOrSummary = "Detail" Then
                If magstatHelper.FetchMagazineLevel(pubprof.MasterLevel) = "Magazine" Then
                    rpt = New rptDetailMagazineMagstat
                Else
                    rpt = New rptDetailMasterMagstat
                End If
            End If

            If rpt IsNot Nothing Then
                Dim dfDestOptions As New DiskFileDestinationOptions
                dfDestOptions.DiskFileName = strFileLoc

                Dim excelFormatOptions As New ExcelFormatOptions
                excelFormatOptions.ExportPageBreaksForEachPage = True
                excelFormatOptions.ExcelUseConstantColumnWidth = False
                'excelFormatOptions.ExcelAreaType=AreaSectionKind.GroupFooter

                Dim excelExportOptions As New ExportOptions
                excelExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
                excelExportOptions.ExportFormatType = ExportFormatType.Excel
                excelExportOptions.ExportFormatOptions = excelFormatOptions
                excelExportOptions.ExportDestinationOptions = dfDestOptions

                rpt.DataSourceConnections(0).SetLogon("Seymour\Helios", "kkb@reF4Tfr333")
                rpt.SetDataSource(lstMagstat)
                rpt.Export(excelExportOptions)
                'rpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.Excel, strFileLoc)
                Return strFileLoc
             Else 
                Return ""
            End If
        Catch ex As Exception
            Throw New Exception(ex.Message & ex.InnerException.ToString)
        End Try

Broke your post into parts for clarity

former_member183750
Active Contributor
0 Kudos

First. You do not need

rpt.DataSourceConnections(0).SetLogon("SeymourHelios", "kkb@reF4Tfr333")

if you are passing a dataset to the report.

Second, I'd re-arrange the code and set the datasource right after you load the report, then do the export.

If the above does not help, see the blog[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13270] [original link is broken] [original link is broken] [original link is broken]; for troubleshooting steps.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Kudos

Hi Ludek

Thanks for the quick response, the bit of code with username/password is commented out and was us trying to get around the problem so is irrelevant.

I've applied the setdatasource code right after instantiating the report and no joy we still get the Database Logon Failed error. As I am not using a dataset due to performance reasons and am using a Generic List/List Of/IList collection the link shouldn't really apply.....unless you have another suitable one

I really need to get this fixed tomorrow so am hoping you can provide your expertise in helping me

Thanks in advance

Terry

former_member183750
Active Contributor
0 Kudos

I don't think this is going to be easily solved over the forums, particulalry if you are under such a tight deadline. I'd highly recommend creating a phone case here:

http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryI...

and even then, to have it resolved by tomorrow may be questionable.

One thing you can try is compare the dlls loading on the working box and the box that is failing. Use the [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility for that.

Ludek

Former Member
0 Kudos

Hi Ludek

Thanks for the response, I've been looking at the Modules tool. Pretty useful, shows up a lot of discrepencies between the target machine(which is a server) and my development machine. Certainly I'd expect differences, but expect the runtime install including merge modules to put on the server anything required. Do you suggest copying all missing dlls from my machine over to the server? Or is there an sdk runtime install?

There is no way my company would pay to raise a support call for a product they have paid for, all steps in terms of using the sdk and deploying the runtime have been followed to the letter of the documentation so it should be working and they'd expect (correctly I feel) this to be within the support they should get for purchasing the product. So can you pass me the details of the official product support and I'll get in touch with them

Thanks

Terry

former_member183750
Active Contributor
0 Kudos

Copy? Never. Well almost never, or in desperation only. The differences to look at would only concern Crystal Reports runtime and the framework.

Re. details of the official product support.

See the [Technical Support Program Changes for Volume Products|http://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/00342fca-2829-2b10-6e8c-80ceb2c47c4e] [original link is broken];.

Other than that, I'm not sure what you mean by "I'll get in touch with them".

Ludek

Former Member
0 Kudos

I think desparate times are upon us, in order to test the problem further we tried installing crystal 2008 on the server however its still failing on the export with exactly the same error Database Logon Failiure. I've used crystal for 8 years and never experienced this sort of problem before other problems but not this.

All I'm trying to do is load a report and give it the data and export it, if you have no other suggestions then I'll have to copy every dll from my development machine to the application directory on the server......I hope you come up with some magic idea though as that isn't sustainable for deployment and my machine cannot be used to run the application. I suppose an option is to develop the report outside of .Net and load it in but then I'd have to use a dataset/reader and export the schema to xml to design the report. Any views on that succeeding where this currentl;y fails?

I read the link and this is the "support", was a bit shocked at being advised to pay for support for a product that should do a job but isn't and that the support is a forum. Any help you can now offer to get it fixed is appreciated, otherwise my company will no doubt ask me to re-develop it in another way which isn't a possibility time wise and totally negates the point of the product

Thanks

Terry

0 Kudos

Hi Terry,

Please explain what this is: rpt.DataSourceConnections(0).SetLogon("Seymour\Helios", "kkb@reF4Tfr333")

Specifically: "Seymour\Helios", "kkb@reF4Tfr333"

It may be that your log on info is invalid because of the "\" and the "@" in the values.

Some DB Servers do not allow those shift character.

What DB are you using and how are you connecting?

Does it work using that log on info in CR Designer?

Thank you

Don

Former Member
0 Kudos

Hi Don

You can ignore that line, I tried to fudge in connectivity settings of the server it runs on to see if I get past the error as per some google advice. But in the running code it is commented out. I edited my original post to comment this out but it was after you kindly put it in a more readable format. So the line should be classed as irrelevant.

The report does not connect to any database server per say. What we are doing is designing the report inside of Visual Studio and linking to a class in the project to design the report. At run time we then build a list of the class(with lots of complicated in memory proprty code) in question. At this point everything is working fine on the server and we have the in memory list and the report loaded.

I've done some further error trapping and it errors on the rpt.Export(excelExportOptions) line. It must be missing some dll's in the runtime on the machine we are deploying to, any advice you can offer at this stage would be potentially life saving!!!! On looking that the excellent modules tool(really impressed with that) there were some dll differences, I don't know if that will help you or not.......(I noticed EBUS-3-3-2-6.DLL and ETC-1-0-12-5.DLL being Excel Export dll's and U2DDISK.DLL and x3DDKEN.DLL being disk export dll's however we have now installed full version of Crystal on the deployment machine so these are all in place but not in the application directory.....

Its also worth noting that we are using copy and paster deployment. The assembly is built onto the dev machine and then copied to the machine in question...

Thanks very much in advance

Terry

Former Member
0 Kudos

Hi Don/Ludek

Thanks very much for your help with this, I have managed to resolev the problem. On the target machine someone had installed the Runtime for VS 2008 on the machine and placed the dll's in the application run folder. So my application was trying to use the full CR 2008 libraries but because of them being in the same location as the application it was picking the older version. So its all now working perfectly

Apologies for being frustrated, I was getting a bit of pressure to fix it and a lot of moaning about the lack of official support of a product i had sung the praises of. So thanks again

Terry

former_member183750
Active Contributor
0 Kudos

Ouch. Who ever copied the runtime to the app dir should be... umm, something :). No idea why they's want to do that. There is absolutely no need, no advantage to it as all versions of CR since v9 are side by side compatible.

Anyhow, great to hear it's working now.

Happy coding and have a great weekend,

Ludek

Answers (0)