.netsql-servervb.netcrystal-reportscrystal-reports-2010

On changing connection with crystal report forms


I am having a serious trouble trying to move my VB.Net project which uses SAP Crystal Reports to another computer (which has its own local MSSQL database). When I first made this project, the computer name on which I worked was "LUKA-LAP", and I had it set up to work with the database on that computer named "LUKA-LAP\SQLExpress". Now I want to migrate my app to another computer(let's call it target computer), so I have to rebuild it and change the computer(server) name to match another computer. However, I don't see how I can do it without installing VS on that(target) computer and recompile the whole project on it, which seems like a lot of useless work. I am trying to rebuild it from third computer(the current one I own) on which I have VS and all tools installed, and there I succeeded in making it work by adjusting the name of this computer. But I don't want to install VS on the target computer. However, when I try to manually enter the name of target computer, VS first tries to connect to its server, but of course doesn't find it(we are not on the same network atm), and refuses to remember the connection name with the target computer's name. Is there any possible way to bypass this check and just memorize the connection, so that when I run it on target computer, it just works?

Ideally, I would like to have something like Connection String from my project and use it for Crystal Report form for connection, while keeping my old commands(queries).


Solution

  • When I want to change database, from say test to production, or vice versa, I go to Database > Set Datasource Location... From there, I select a previously created connection name, or Create a New Connection.

    When moving between computers or servers, you can alternatively reference a DSN in ODBC Administrator. The connection details may differ between computers, but the DSN name you reference is the same. This avoids situations where hard coded details are different.

    If you have sub-reports, you will need to update the datasource for each sub-report as well.

    Update Datasource Location