esierp
April 5th, 2000, 03:27 PM
I have created a data environment, a connection, and a command within the data environment designer. I then bound a report and it's controls to that command. My problem is that when you use the data environment, you set the location of the database in the connection properties at design time. This is fine during design, but I need to be able to move the program around and therefore be able to change the location of the database programatticaly. How can you set this location programatically? I have tried altering the ConnectionString at run-time, but when I run the report bound to it, I receive an error: Method 'Item' of Object 'Commands' failed. This error occurs when I try to set the parameter of the parameterized query that I am using for the command object. Once I receive this error, I can click debug, then click "Play" again and it will work fine. But this error only occurs if I change the ConnectionString, otherwise everything works perfect. So this takes me to trying to figure out how to set the location of the database at run-time. If anyone has any suggestions, I would appreciate it. Thanks in advance.