Nice idea..
But too weird and not everybody has the required objects to do this.
Think I will work with Howard's DLL. Win32Admin.DLL updated
I was going to go with Internet Data Transfer Library for MS-Access as what the target audience will be using it for transferring a Database.. But, Howard's code usage is much simpler.
This was originally prompted by Looking for a good FTP Client.
code:
break on
$db = "N:\usersdatabase\users.mdb"
; -- Step one - Determine where MS-Access installed for the executable
$Access = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MSACCESS.EXE","")
; -- Step two - Compact the database each time before transfer as there will be alot of inserts done on it
; -- Developer's Note: MS-Access is notorious for "bloat" when inserts are done and/records removed
RUN $Access + " " + $db + "//compact"
SLEEP 1
; -- Step three - Start the FTP Process
$Win32Admin = createobject("Win32Admin")
; Method FTP($RemoteServer, $Account, $Password, $Mode, $LocalDir, $RemoteDir, $Action, $Filename)
; $Mode -> [ascii|binary]
; $Action -> [get|put|size]
;
; Performs the specified FTP operation.
; Be sure to double the "@" in the password or email address if used for anonymous logons.
$RemoteServer = 'someserver.com'
$Account = 'userid'
$Password = 'password'
$Mode = 'binary'
$LocalDir = 'n:\usersdatabase'
$RemoteDir = 'database'
$Action = 'put'
$Filename = 'users.mdb'
IF $Win32Admin.FTP( $RemoteServer, $Account, $Password, $Mode, $LocalDir, $RemoteDir, $Action, $Filename)
? ? "FTP successful"
?
else
? ? "FTP Failed! @serror"
?
endif
Thanks,
Kent