StrataFrame Forum

Is there a way to automatgically point the application to the correct database?

http://forum.strataframe.net/Topic30789.aspx

By Marcia G Akins - 1/9/2012

Hi all.

I am getting ready to deploy a new winforms app to several dozen users. These users are not extremely computer literate. I am going to programmatically create a desktop shortcut for them and I do not want them to have to point the application to the correct database the first time that they run it. Is there something that I can do so that the app knows which database to connect to without user intervention the first time they run the app?

TIA

Marcia
By Edhy Rijo - 1/9/2012

Hi Marcia,

Sure you can.  The connection string is stored in the AppKeys.dat and Connections.dat files which will be created in the folder C:\Users\All Users\MicroFour\ConnectionData.  My suggestion would be to do the following:
  • In your computer, make a backup copy of those files and delete the .dat files.
  • Open your application so the connection string will be created as expected on the end users computer.
  • Copy the new .dat files to another folder to be deploy with your application.
  • Restore your original .dat files so you can have all connections for all application you have been working on.
Now, the trick is to use your install program to find the All Users folder and create the MicroFour\ConnectionData folder and copy your .dat files there.

Good luck!
By Marcia G Akins - 1/9/2012

Edhy Rijo (1/9/2012)
Hi Marcia,
  • In your computer, make a backup copy of those files and delete the .dat files.
  • Open your application so the connection string will be created as expected on the end users computer.
  • Copy the new .dat files to another folder to be deploy with your application.
  • Restore your original .dat files so you can have all connections for all application you have been working on.
Now, the trick is to use your install program to find the All Users folder and create the MicroFour\ConnectionData folder and copy your .dat files there.

Good luck!


Hi Edhy.

Thanks so much for the response. The trick is also going to be creating the desktop shortcut from a web page. This app is replacing a web app that they are currently using, so when we go live, the powers that be want the current app to point to a page that will handle pointing them to the new app.

It's always an adventure. Smile
By Edhy Rijo - 1/9/2012

Marcia G Akins (1/9/2012)
[quote][b]...The trick is also going to be creating the desktop shortcut from a web page. This app is replacing a web app that they are currently using, so when we go live, the powers that be want the current app to point to a page that will handle pointing them to the new app.


Hmmm, interesting, but just for clarification, your winform application will be replacing a web application, right?  If so, then, what I would do is create an installation setup with any tool (I use InstallAware), upload the setup to a web folder where they can just download it, run it and start using it.  I do that all the time with some of my applications which does not require the user to select anything.