what i am trying to do is make all the FE update so i have created a batch.bat file which will copy the new FE over the old one. now i want to open the new FE. which means i have put in the path to msaccess.exe and the path to the new FE so it will open up. because batch are a bit like dos it does not like spaces i have to put it in " " so it will work. it dont make a difference witch way i do it i cant get the first " to go in if it does go in the rest wont. now if i put it into a text field i will then be able to extract it i hope. does this make it clear. thank you for you help
No, that will not help. for starters, msaccess.exe is registered in your path file and does not need to be explicitly called. Windows will implicitly know that files suffixed in mdb/mde/adp/ade are to be opened with access.
The issue is FAR more likely to reside with your batch file itself.
2. Visual Basic is very touchy about doing things with files (like copy) when the file is in use (such as Open). I haven't tested using batch files for this purpose while files are in use, but I suspect it is susceptable to errors.
I do something similar, using a couple API calls and a few standard conventions. I have an application where the FE resides on the network. Each user has a small executable that determines the presence and version of Access and Excel the user has (97, 2000, runtime, full, etc.). Providing the appropiate software is present, the program then copies the FE to the user's Temp directory using a crytic file name and then explicitly calls Access to open the file (since the file extension is not mdb).
Among other things, this was meant to improve security (the FE and BE are both stashed away in an obscure location). It also makes updates a piece of cake - there is NEVER a user in the FE on the network, so I can post an update and then broadcast a message for all users to exit and reopen the application, causing an automatic update.
Version, Location and other info about software is in the registry. So is the explicit location of the user's Temp folder.
Just out of curiosity, what version of Access are you using? Is there a reason you're not using the FileCopy method? Perhaps you could use a parameterized batch file (%1, %2 etc represent command line arguments). Also, are you trying to overwrite the currently running database? That may not work so well... Oh, and depending on version, why not use application.opencurrentdatabase?
1 i am using access 2000
2 my FE shuts down then runs the batch but i want the batch to run the FE again. i do know that msaccess.exe has to be in quotes and i can get them at the end no problem but if i put them at the start all i get is "strCommanda & msaccess.exe"
Good point Teddy. My experience has been that if Process A starts Process B, and then closes itself, all appearences are that Process A is now closed, but it's an illusion - Process A doesn't truly close until Process B is done/closed.
ok, so get to slide when using a batch file goes to show that the old DOS relic is better than the options Microsoft gives you .....
It also tells us the problem is with the command line that opens your file in the batch file, not Access.
Can you hand write a batch file that will do what you want? If not - get cracking. If so, post the contents of the batch file that works and we'll help you write the code that will create that batch file.
There is a catch: are ALL of your front end workstations running the same version and same type of Access install? For example, the command line for Access Run-Time is different from the command line for Access Full-Install.
I still see a problem here. Open your access database and then perform the actions you want the batch file to do by hand. You may notice that it is somewhat difficult to overwrite a file that is already open...