Jim,
Some basics.
1. Standard VBA modules (not class modules) are easier to work with
initially but if you like working with object oriented code like Pascal
(which VBA resembles) or C++ then class modules are a better way to go.
2. Debugging is much easier if you habitually write functions that return a
value indicating the outcome of the function--it worked would evaluate to
True, it errored out for some reason would return the numeric error code.
3. Both the DAO and ADO libraries include objects which will execute your
SQL. DAO has QueryDefs and the dbEngine.execute method. ADO has its
Command object.
4. The Connection object of ADO has a ConnectionString property which
includes a login name and password attribute. A little simple string
concantenation will let you insert your login name and password. The
weakness here is that the account name and password can be stored in the VBA
module as clear text and that weakens database security. This can be
mediated if you ask the person running the routine to provide their login at
run time.
5. Your algorhythm is: a. Execute an SQL DELETE statement to dump the old
records, Execute an INSERT statement which pulls the new data, but you
probably knew that.
6. The desktop version of SQL Server included in Office since 2000 does
support scripted SQL and may be a better option if you are used to better
database engines which support more of the ANSI SQL standard.
<ji*********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am experienced with databases and sql, but lacking in vba skills.