cancel
Showing results for 
Search instead for 
Did you mean: 

login failed

zeljko_mrcic
Explorer
0 Kudos

Hi to all...

I have problem with subreport logon...

I have app running on one pc with SQL2005Express installed on that machine. Reports are working fine, with logoninfo or without it, with setting logon details for each subreport or with no setting.

Over mapped drive other users are starting that same app and they get log on error on reports with subreports. Reports with no subreports are working fine. Been everywhere, tried everything....

Subreports and main report are SQLNCLI...installed that on all machines starting app...

Tried to change provider in code....no luck.

Form with crystal print preview is opening but it is asking for uname and pwd...If I type them or choose integrated security, still the same.

I'm using VS2010

my code:

Dim oRpt As New rptKalkulacijaCene

                myConnectionInfo.AllowCustomConnection = True

                myConnectionInfo.ServerName = sServer

                myConnectionInfo.DatabaseName = "Oktan"

                If My.Settings.CNN.Contains("Password") Then

                    Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder(My.Settings.CNN)

                    myConnectionInfo.Password = builder.Password

                    myConnectionInfo.UserID = builder.UserID

                Else

                    myConnectionInfo.IntegratedSecurity = True

                End If

                myConnectionInfo.Type = ConnectionInfoType.SQL

                Dim myTables As Tables = oRpt.Database.Tables

                For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables

                    Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

                    myTableLogonInfo.ConnectionInfo = myConnectionInfo

                    myTable.ApplyLogOnInfo(myTableLogonInfo)

                    myTable.LogOnInfo.ConnectionInfo.ServerName = myConnectionInfo.ServerName

                    'For i As Integer = 0 To myTable.LogOnInfo.ConnectionInfo.LogonProperties.Count - 1

                    '    If myTable.LogOnInfo.ConnectionInfo.LogonProperties(i).name = "Provider" Then

                    '        myTable.LogOnInfo.ConnectionInfo.LogonProperties(i).value = "SQLOLEDB"

                    '    End If

                    'Next

                Next

                Dim subReportDoc As CrystalDecisions.CrystalReports.Engine.ReportDocument

                Dim subReports As CrystalDecisions.CrystalReports.Engine.Subreports

                subReports = oRpt.Subreports

                For i As Integer = 0 To subReports.Count - 1

                    subReportDoc = subReports(i)

                    For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In subReportDoc.Database.Tables

                        Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

                        myTableLogonInfo.ConnectionInfo = myConnectionInfo

                        myTable.ApplyLogOnInfo(myTableLogonInfo)

                        myTable.LogOnInfo.ConnectionInfo.ServerName = myConnectionInfo.ServerName

                    Next

                Next

                    oRpt.RecordSelectionFormula = "{vw_sintetika_analitika_rpt.id_godine}=" & iPoslovnaGodina & " and {vw_sintetika_analitika_rpt.TipDokumenta}=" & eTip & " and {vw_sintetika_analitika_rpt.BrojDokumenta} in[" & lblKombinacija.Tag & "]"

                    Dim bTree As Boolean = False

                    Dim x As New Form2

                    bTree = True

                    x.CrystalReportViewer1.ReportSource = oRpt

                    x.CrystalReportViewer1.ShowGroupTreeButton = bTree

                    x.CrystalReportViewer1.DisplayGroupTree = bTree

                    x.ShowDialog()

Any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

zeljko_mrcic
Explorer
0 Kudos

Since there was no reply I have decided to change configuration. I installed app on pc that could not print reports and simply access SQL server over network.

PC has SQL express installed on it,(No SQLNCLI issue) I can access my database over SQL studio, I have udl and app working just fine. But CR is not working again. Here is the error

System.Runtime.InteropServices.COMException (0x8004100F): Logon failed.

Logon failed.

Details:  [Database Vendor Code: -1 ]

Logon failed.

Details:  [Database Vendor Code: -1 ]

Error in File temp_213de768-3c01-40c7-9d0e-5352df09ea73 {79ED81C4-D904-4E88-B844-735592058CB0}.rpt:

Unable to connect: incorrect log on parameters.

   at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable)

   at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value)

I gooogled it, there are no -1 db vendor code posts. I have report and sub report so I guess upper two lines are for each of them.

Anyone?

former_member183750
Active Contributor
0 Kudos

Hi Zeljko

Just a bit of a note why no reply. These are community forums, no support and while we at SAP do monitor and try to answer in timely manner, your post was late on the 18th, then the weekend, so...

Anyhow, Database Vendor Code: -1 should be documented in your database manuals somewhere. If not checking with MS may not be a bad idea.

Now,

looking at the description of the issue, there are two initial possibilities that occur to me:

1) The main report is connecting via ODBC, the subreports are connecting via OLE DB (or other). So check that both are using the same connection type.

2) A possible permission issue of some sort.

Using crlogger will be helpful in both of the above. See KBA

1553469 - How to enable Database logging in Crystal Reports for Visual Studio 2010



- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

zeljko_mrcic
Explorer
0 Kudos

Could not wait no more...

just changed all of my reports from SQLNCLI to SQLOLEDB...and it is working.

Reading all possible threads on google, all similar topics I came to conclusion that no one knows what is going on in CR engine considering logon model.

No help, no support.

Strange, since SQL has its libraries, so in theory, using SQLOLDB should be same as using SQLNCLI.

Strange, since CR is part of VS.

I'm using CR for 10+ years now. It is possible to create any kind of report, anything clients can imagine. On the other hand, I'm always in doubt if it will work. To many 'save data with report' and such 'cool' stuff.

In Pagesetup dialog, I do not know why, if you select some printer(default) in developin phase, and let's say it is OneNote, when user try to print it is sending report to OneNote, not to default printer....

I have complex app and 90% of time I was trying to set up CR, nothing else, no dll's no 3rd partie user controls...

I think it should be much simple.

zeljko_mrcic
Explorer
0 Kudos

new problem now...

dates are displayed different than in local settings. Changed in registry, no use...

what is next?

maybe it is not correct to ask it here, but is there any other tool for reports...CR is full with bugs.

thx

former_member183750
Active Contributor
0 Kudos

Next? New Discussion please. As per the SCN Rules of Engagement, one issue per Discussion. This is to help searching for issue and other reasons.

- Ludek

Answers (0)