Hi Ludek
Thanks for your help on this. It really is driving me mad and stressing me out as I have a deadline to deliver working reports next week.
In fact, to help, do SAP have a paid for support service by phone where someone can work through this with me?
In the meantime I have an update. I was trying to implement this code in my existing web project so decided to create a new bare bones web application and put a report in it with the server switching code. And it worked! So I created another report with exactly the same settings as the first and it does not work! 2 reports in a basic project. One will switch servers, the other just stays showing data from the server selected at runtime. I literally run the exact same code, just changing the name of the rpt file and it stops working. This is really weird. So I went back to my original project. Deleted the report that didn't switch. Created a new one and still the same problem. No switch.
Something is not right. There must be some small step I am doing different that is making the report switch servers ok. But I don't know what it is. And in any case. Surely CR should not be so fragile that it will ignore hard code that tells it to connect to a specific server?
I have looked at the 2 rpt files. Obviously the rpt file is binary so can't tell much from that. But the 2 report vb files look just the same apart from their names in the code. Is there any way of examining the rpt files to see what it is about them that is stopping it working? Just a long shot.
Btw, I will try the full version of cr (I have a licence) but not sure what it will prove. The report will display data from both servers quite happily in design mode in VS. I just right click on the database icon, change the datasource to the other odbc dsn and the data switches. It is in the code that it will not.
Btw, is there any benefit to designing my reports in the full version of CR? I have bought a full licences copy (2 actually, one for my team mate) but am a bit nervous to install it as I don't want to break my VS environment.
Thanks again for your help
Mark