Skip to Content
avatar image
Former Member



I pass the data to connect to the database through this command:

report.SetDatabaseLogon(UserId, Password, ServerName, DatabaseName);

When I open the report , It asks for the password instead the other 3 fields are filled.

In the RPT file, use the udl file to connect to the database. This is the connection string:

[oledb] ; Everything after this line is an OLE DB initstring

Provider=IBMDASQL.DataSource.1;Password=********;Persist Security Info=True;User ID=BARCODE;Data Source=*******;Initial Catalog=B00839AA

When viewing the report I used the following code:

Dim logonInfo As New CrystalDecisions.Shared.TableLogOnInfo() Dim table As Table report.Load(NomeSTP) For Each table In report.Database.Tables ' Get the TableLogOnInfo object. If table.LogOnInfo.ConnectionInfo.ServerName = "******" Then logonInfo = table.LogOnInfo ' Set the server or ODBC data source name, database name, ' user ID, and password. logonInfo.ConnectionInfo.ServerName = "" logonInfo.ConnectionInfo.DatabaseName = "B00839AA" logonInfo.ConnectionInfo.UserID = "BARCODE" logonInfo.ConnectionInfo.Password = "*********" ' Apply the connection information to the table. table.ApplyLogOnInfo(logonInfo) CrystalReportViewer1.ReportSource = report

But it doesn't work.

If you first open the preview of the report and save it Without modifying anything and then you open the report

it work correctly.

How can I fix it?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 24, 2018 at 04:52 PM

    CR Designer no longer installs the .NET SDK package.

    Go here to get it:


    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2017 at 05:40 PM

    Hi Stefano,

    It looks like you are going through each table in the report which is good. Does your report have subreports? If it does then you will need to open each subreport and use LogonInfo the same way you did for the Main report.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      my reports don't have subreport.

      i use logoninfo for the main report.

      the reports were create with crystal report XI R2 (11,5) but now i use the last version of crystal report (14) for visual studio 2012.

      If i open the prewev of the report with visual studio and i save the report , Then the report don't ask the password . Initially the report weighs 18Kb after i open the prewev and save it , it weighs 64Kb.