Smartin <smartin108@yahoo.com> wrote in
news:X_udnRBJZe7JU8zeRVn-jA@giganews.com:
[color=blue]
> Bob Quintal wrote:
>[color=green]
>> Yes, create the code for a delete query and an insert query
>> using the general form of
>>
>> DeleteSQL = "Delete * from table1;"
>> AppendSQL ="INSERT into table1 Alias Target .... SELECT ...
>> FROM Table1 IN C:\OtherDir\Production.mdb Alias Source;
>>
>> And execute them from code.
>>
>> sql.execute strDeleteSQL
>> sql.execute AppendSQL[/color]
>
> Thanks for that! OK I've got this working. I copied the prod
> table into my database, set up a table to record when
> refreshes are done, and wrote some routines fired by the
> form's open event that check the last refresh time to see if
> it's time to refresh again.
>
> More questions?
>
> 1. The delete/insert queries take a few minutes to complete.
> Potentially other users will try to open the database while
> updates are in process. Is there a way to lock out other users
> while the update is underway and signal to them to wait a few
> minutes? This app will deployed on a shared network resource.
>[/color]
I have my routines fire at 2:00 AM. You can write a command
line that starts a macro, which runs the code and quits the
application. Use the command in Start->settings->scheduled
tasks. It's the only macro in the database, everything else is
in modules
[color=blue]
> 2. What if the prod database is currently in use when a user's
> instance determines it's time to refresh? Can I detect this
> somehow so I can code around it?
>[/color]
see above or below.
[color=blue]
> 3. Is there a way to capture the current user's name? It's not
> required at the moment, but may be useful later.[/color]
Yes, see
http://www.mvps.org/access/general/gen0034.htm if you
have security enabled, and
http://www.mvps.org/access/api/api0008.htm if you don't
[color=blue]
>
> I seem to be drifting away from my original topic. Thanks for
> all your help![/color]
That's databse development.... one thing leads to another.
--
Bob Quintal
PA is y I've altered my email address.