Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2004, 10:26 PM
Authorized User
 
Join Date: Jul 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default Program change deployment

I have a number of users accessing an 'adp' file with a SQL 2000 database. Upon opening the 'adp' file, I check if they are accessing the most recent version, as changes are requested on a weekly basis. I would like to automate the 'adp' file copy as follows:
  1) Copy the new 'adp' version to a Directory on their C: drive (replaces old version)
  2) Open that new version
How do I go about accomplishing this?

 
Old January 22nd, 2004, 10:20 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Easy. Put a small vb compiled script on their desktop and run it after the check. This file would do a file copy. Put a file on the network that they wouldcopy. To make things easier, make sure you use a file dsn.
Lookup the filecopy sintax in vb help or access help.



Sal
 
Old January 23rd, 2004, 02:32 PM
Authorized User
 
Join Date: Jul 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the tip. I'm not familiar with vb script but so far have come up with the following:
   OPTION EXPLICIT
   CONST SOURCE_PATH = "T:\Current Program\"
   CONST DEST_PATH = "C:\TestScript\"
   CONST FILE_EXT = ".adp"
   Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
   If Not fso.FolderExists(DEST_PATH) Then
          fso.CreateFolder DEST_PATH
   End If
   fso.CopyFile SOURCE_PATH & “Test” & FILE_EXT, _
                DEST_PATH & “Test” & FILE_EXT, True

How do I invoke the VB Script file from within the Access Data Project?
I assume I would have to close the 'adp', run the Script, reopen the 'adp'.

 
Old February 16th, 2004, 07:39 PM
Authorized User
 
Join Date: Jul 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Decided to add code for a shortcut. I then inform the user of the change and exit Access.

 
Old February 16th, 2004, 11:19 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is the idea. You can create an executable in VB that does this file copy for you.
From the splash screen of the .adp, you check for the correct version. This can be a field in the database or a file in the network, your choice. Database will be best.

If the database is a different version, you invoke the executable and close the .adp. The firts thing that the executable does is inform the user that there is a new version and prompt with a message box. This allows the adp to close in time for the file copy.
The executable then does the file copy and informs the user that the upgrade was done. Also tells the user that she/he can re-open the .adp, mdb, mde, ade.

You can put this executable on the network, but remember that if you have 1000 users, the file will give you a sharing violation some time. I ussually put this file in the C: drive of the users machine, and I change it as needed in case I need the file to do more than just a file copy.

Have fun.



Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Deployment regbnvl BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 May 7th, 2006 04:44 PM
Setup Project: Program not added in Start>Program arif_1947 VS.NET 2002/2003 2 March 31st, 2005 06:40 AM
Start a program inside another program Silje Classic ASP Professional 1 November 16th, 2004 02:08 AM
Deployment Bhavin Crystal Reports 2 October 25th, 2004 08:28 AM
Update excel cells on change of another program pjhlin VB How-To 2 January 20th, 2004 11:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.