Crystal Report Logon method

leechoonhwee
leechoonhwee used Ask the Experts™
on
Hi all,

I have the following logon which works fine with ODBC

 For Each Table In theReport.Database.Tables
            Dim Logon As CrystalDecisions.Shared.TableLogOnInfo
            Logon = Table.LogOnInfo
            Logon.ConnectionInfo.ServerName = "ODBCServerName"
            Logon.ConnectionInfo.DatabaseName = "MyDatabase"
            Logon.ConnectionInfo.Password = "MyPassword"
            Logon.ConnectionInfo.UserID = "MyUserID"
            Table.ApplyLogOnInfo(Logon)
        Next

However, I switched service provider which does not have ODBC available and in this case, how do I modify the above to convert the ODBC to ip address instead?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi, to which database you will be connecting now?

Author

Commented:
I have migrated everything to another service provider and hence everything is the same except the server

Therefore, in the past I am using ODBC but now I have to use IP address instead
Try to change this with the ipaddress:

Logon.ConnectionInfo.ServerName = "IPAddress" provided that your databasename, username & password are the same on the new provider as well.

Author

Commented:
I tried that of course but it does not work. I was on the impression that

Logon.connectioninfo.servername only refers to DSN name only?
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
You probably need to change the report to use a different database connection method.  I don't believe you can do that through code.

The report is expecting an ODBC connection so you have to change it.

Use the DATABASE --> SET DATA SOURCE LOCATION

mlmcc

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