cancel
Showing results for 
Search instead for 
Did you mean: 

Database logon coming up

Former Member
0 Kudos

I am trying to call a report based on an Advantage database from a .net Application. This is the code that I use

d = New ReportDocument

d.Load("C:\test\bill.rpt")

d.SetDatabaseLogon("adssys", "MCSSTIME", "taxm_narrows", "C:\Development\Customer Data\data_narrows\TaxM.add")

CrystalReportViewer1.ReportSource = d

I get no errors but the problem is that the database logon box comes up every time. Also, when the box comes up, the server name and database are greyed out but I can see that they are the server/database that the report was based on, it doesn't change

I've also tried this:

Dim ci As ConnectionInfo

ci = New ConnectionInfo

ci.DatabaseName = "taxm.add"

ci.IntegratedSecurity = True

ci.Password = "MCSSTIME"

ci.UserID = "adssys"

ci.ServerName = "taxm_narrows"

d.Database.Tables(0).LogOnInfo.ConnectionInfo = ci

and This:

d.Database.Tables(0).LogOnInfo.ConnectionInfo

.DatabaseName = "taxm.add"

d.Database.Tables(0).LogOnInfo.ConnectionInfo

.IntegratedSecurity = True

d.Database.Tables(0).LogOnInfo.ConnectionInfo

.Password = "MCSSTIME"

d.Database.Tables(0).LogOnInfo.ConnectionInfo

.UserID = "adssys"

d.Database.Tables(0).LogOnInfo.ConnectionInfo

.ServerName = "taxm_narrows"

All of them end up with the same results. I can use this same code with SQL server and it's fine. what am I missing?

View Entire Topic
former_member208657
Active Contributor
0 Kudos

The approach I always take when I'm not sure what to set for database logon info is to design two reports. The first will connect to my original database. The second will connect to my destination database. I'll then look at all the ConnectionProperties for each Crystal Report by stepping through my .NET application.

The one piece I noticed you missed in your code is that you are not applying any of the ConnectionInfo to your Table. You'll need to use the Table.ApplyLogonInfo() method to make sure your changes stick.