Todd said:
Is it possible to have an access database updated from an Excel
workbook/worksheet. I want the database to be updated everytime the Excel
file is updated. Or, is it possible to create an access database that will
include the web queries that are created in an excel file?
It seems to me you want to detect the change in Excel in real time and
notify the database of the changes at this time e.g. open an ADO
connection and issue some SQL (this would discount using the MS Access
app).
What changes are being made? If it was a user editing a worksheet, I'd
suggest using an event (e.g. Worksheet_Change) and issuing an INSERT
INTO (new row) or UPDATE (amended row) command with the appropriate
column values or a DELETE command. To be able to associate a row in
Excel with its corresponding row in the database, I think you will need
to use a key column(s) common to both and use it in the aforementioned
command. You'd also have to lock down some columns/rows to try to avoid
the illogical things users are apt to do (deleting the column
containing the key values or the header row, destroying row continuity
by shifting down cells, etc) but allow then to flag a row as new or for
deletion.
If it is a bulk change (e.g. following the refresh of an embedded
query) you'd again need a key to be able to make a comparison to the
data in the database to detect which rows are to be
inserted/amended/deleted. With Jet, you can create JOINs in SQL between
the data in Excel and the .mdb to see these changes. See a previous
post by searching google groups for the exact phrase, "basic 'template'
for comparing".
....Unless the database is being used as a 'dumb' data store, then you'd
just DROP the table (unless it was a 'history' table with a timestamp
column <g>)and SELECT..INTO to recreate using all Excel rows in one
hit.
Jamie.
--