This is similar to the last post I made entitled Error Message but different enough that I thought it would be better to start a new thread. I'm trying to display a set of three crystal reports that are populated through a sql database. When I first started looking at them, I found that all the code behind was structured correctly which puzzled me a little bit. Upon further investigation I discovered that within the .rpt file, the Database was pointed to a database that didn't exist. So, I changed it to point to my localserver. Boom, it works. This shouldn't be how it always has to be set though. In one of the other two reports, I left the DB set to the nonexistant one and went back to the code and traced it though. Everything works fine, up until the point where it goes to apply the logon info to the table then it reverts back to whatever was preset in the form itself. For example:
TableLogOnInfo info = new TableLogOnInfo();
ConnectionInfo conn = new ConnectionInfo();
conn.ServerName = "Server";
conn.DatabaseName = "DB";
conn.UserID = "sa";
conn.Password = "sa";
then...
foreach(table in Database.tables)
info = table.LogOnInfo;
info.ConnectionInfo = conn;
table.ApplyLogOnInfo(info);
When first entering the loop ConnectionInfo is set to the database properties of the report itself, we'll say Server1, DB2, user, password, after it has been set to conn, it all changes to match whats written above. After the ApplyLogOnInfo line though it reverts back to the Server1, DB2, user, and password. I am pretty sure this is why it's not pulling the reports but I don't know why it's not properly assigning the credentials. Any help would be appreciated.
Eric
PS If any of this needs more clarification please let me know and I will do my best to help.

Login Error