Ok, so here is something that I have been trying to accomplish and am having some problems with figuring out how to do. I have program that I would like to have operating on multiple systems and updating in real-time.
I have seen software, where the install package goes onto an (acting server) and the drive then mapped to another system leading to the path of the installed program.
Once the path has been established the user accesses the given folder through the mapped drive and runs the setup within the install directory on the mapped drive. Thus setting up a workstation, while all the data is stored on the (acting server)
If anyone would have some insight into how this is accomplished it would certainly be helpful in my endevour.
I am using visual studio 2008 (and also have 2010) for development as well advanced installer for the deployment.
Thanks in advance
here is a real life scenerio to help clear up what we are trying to do -
there are 3 systems at one location.
1 of these systems will act as the "server" - meaning all the data from a specific xml file will save to a specific location on that system-
we will call this path as (z)
the other 2 systems will be working with this xml file through a completed vb project.
what we want to happen is when either one of the 2 systems make a change to the xml file inside this project..we want the changes to be saved to the z path on the "server" - which will in turn - show the changes made back to the other 2 systems.
now - most would say that it sounds like a "sql server" is needed - but - we are trying to do this WITHOUT the need for sql server - and are attempting this strictly through coding and mapped drives....is there a way to do this in this manner?? and if so- can someone clarify what needs to happen..and/or- point me in the right direction???
Here's a shot. Your program will read the XML file from the file share (z) when it loads. As with any program, you will control when it saves it's data to the file share. The program will also need to periodically check the share for changes. This will be done by simply reloading the xml at a designated time or through an event, like a button. You don't want this refresh, however, if there are changes in the current local dataset.
User 1 makes a change, saves to z. User 2 makes a change before getting changes. If User 2 saves to z it will overwrite User 1 changes. To make sure this doesn't happen the program, before it saves, would need to load a current copy of the xml on z and compare it to the local data, apply all changes and save.
A problem with save timing would also need to be addressed. If two users are saving at the same time they could have different copies. To address this the program, on save, when it loads the current copy on z, would delete the xml from z, do the comparison and then save. If a user is attempting to save and the xml does not exist on z then the program knows someone else is saving. Since the time to write the xml could be lengthy (and you don't want a program reading a half written file) it may be better to put a small dummy/flag file in the same folder that the program checks to see if someone else is currently saving.
Actually you should be using a Variable in all of those locations for the target path and then somewhere in your program when it first starts you should set the value of that variable to the path you want to write to. This way should you ever need to change it you can change it in one place rather than lots of places and get the same result.
Also you should be aware that under Windows Vista, Windows 7, Windows 8 as well as newer versions of Windows Server you can not write to the program files folder.
You should not hard code a path to z drive either especially not if you intend to have others use your program as most will not have a z drive on their system.
Ideally the target path should use a variable inside the program and that variable should get its value from a settings, config or ini file that is stored on disk there should also be a method inside the program for the user to change this value to point somewhere else if needed.
Last edited by DataMiser; February 14th, 2013 at 01:54 AM.
thank you DataMiser for the informative reply!
yes - you are right about not setting to program files-as anything above xp is a headache waiting to happen for sure! the client system is windows 7 (64 bit)..so installing to program files in this instance will not work to well LOLLLLL - i dont have that many aspirins!
the related z path was just an example - z is used waaaaaaay to often so- i actually want to attempt this by designating it to y, as i have not seen many people try to go to y drive. but your instruction to create a way to change this path, should i need to do so on the fly is very good and thank you for that
in my current solution i have already instilled a refresh for my calendar as well as "concurrency" issues - should one of the 2 systems happen to be making changes to the same calendar block at the same time.
all that remains is the how to...and am really checking in theory of how and IF this will work -
this is what i am planning to try:
taking your advice about the pathing
take the project and aim it to:
c:/MyCalendar/Calendar.xml - this is where it will install to on all the systems.
in my coding - direct the saving, reading,writing to:
in theory..this should work, no?
so that these systems will be working on their own instance - yet sharing just the calendar.xml
Last edited by coding_4_Life; February 14th, 2013 at 07:58 AM.
Reason: want to put codein coe bracket
hi dglienna..thank you for the reply!
i am fairly new in this realm as i have only been coding now for a few years - and i have seen the azure ads but have not looked at any of them as of yet. i will keep your suggestion in my head and start to take a look at that aspect. but at this time, time is not on my side - so while i am not discounting the suggestion in any way, what needs to happen here is the most direct path to make this happen.
i know abolutely nothing about azure and so very little about virtualization. i will however, take a look into these two subjects just as soon as i can come up for air! LOLLLLLL
Yes in theory that should work so long as you are not having issues with 2 people trying to write to the file at the same time. I really do not know a lot about the gotchas of XML I rarely use it in my projects and generally opt for a database or other file type rather than XML. I know a lot of people like to use XML and it is way overused in many cases. I have always saw it as a poor option especially in VB6. There is a lot of overhead with XML, a lot of extra data in the files and the VB6 support for it is less than ideal.
btw I have never been on a system that had a Z drive mapped. my systems here drive letters run C-M
thats the ticket Mur16! worked like a charm, THANK YOU SO MUCH
and on that note - i would also like to thank everyone else that stepped into this with/for me -
much good advice!
there is one final "glitch" that is in the works- but i do not think that this can be solved:
when remoting from the mapped drive - the printing and saving(incidently - my program saves my calendar to excel and prints from xcel)
while this works properly on the host - it will not save or print through the mapped drive.
my guess is that it cannot launch xcel in order to complete this function. but - it does work from the host
like i said - i dont think there is a way to get around this - but if any of you seasoned veterans would like to take a stab at it i am all ears!