Re: Are split databases a chimera of utility?
- From: Dale Fye <dale.fye@xxxxxxxxxx>
- Date: Fri, 29 Aug 2008 09:43:03 -0700
Pete,
Not sure this is exactly what you are looking for, but I'll give it a shot.
If you have a report that is based on a query that takes an inordinate
amount of time to run, and are not concerned with how current the data in the
report is (once a day refresh is fine), then what I have done in the past is
create a new table which has the structure needed for your report.
Then, I add a field (rpt_xxx_Updated_at, DateTime) to my db_Parameters table
(have one of these for almost every database). Then, when someone wants to
run this report, I check to see whether the value in this field is equal to
todays date. If it is not, then I run a couple of lines of code that delete
the old data and insert the new data into this table and update the field
with todays date. It might look something like:
Private Sub cmd_Report_Click
Dim dtLastUpdated as date
dtLastUpdated = NZ(DLOOKUP("rpt_xxx_updated_at", "db_Parameters"), 0)
if dtLastUpdate <> Date() Then
currentdb.execute "DELETE * FROM tbl_rpt_xxx"
currentdb.execute "qry_rpt_xxx_Insert"
currentdb.execute "Update db_Parameters " _
& "SET rpt_xxx_updated_at = #" & date() & "#"
endif
docmd.openreport "rpt_xxx"
End Sub
This way, only the first person who runs the report actually generates the
data for the report. If you need the report to be more specific, then use
the WHERE clause of the OpenReport method to restrict the reports result set.
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
"Author" wrote:
I'm a hybrid of a purchasing agent and half-baked DB guy. I spent a week.
reading tutorials about access and SQL and learned more than my boss, who
heretofore knew more than anyone else did about how our database runs.
Here's the skinny, Chris. I had the idea to change a report's structure
from *running a lengthy query each time it is opened by one of the users* to
*reading data from a table that gets refreshed by an automated query*. Now
my question to you (i.e. the forum) is twofold:
1. How can I update data in a table without incurring Run-Time Error 3009
"Lock table while in use"?
2. If I overwrite a table with a table that has an identical structure (only
different data), is it really modifying the structure?
I hate to argue semantics, but this situation has me peeved. Not your
fault, I know. Chris, thank you for your response. I wish you and all who
read this a fantastic weekend.
-Pete
"Chris O'C via AccessMonster.com" wrote:
No one can modify a database table's structure while it's in use. Not even
you. Not in SQL Server, not in mysql, not in Oracle, not even in Access.
By splitting your db, you gain the advantages of speed for users accessing
the db, speed for developers in development and maintenance, exclusive access
to the front end db when necessary, ease of data backups and restores,
separation of processes for individual users, and you avoid many chances for
corruption. Furthermore you get a chance to see how good a db developer you
are. If performance improves after a db split in a multiuser db, you're good,
if performance degrades after a db split, well...
Chris
Microsoft MVP
Author wrote:
Are they just the tool of a false god?
If I can't modify a table's structure while it is in use,
then what's the point?
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-tablesdbdesign/200808/1
- References:
- Are split databases a chimera of utility?
- From: Author
- Re: Are split databases a chimera of utility?
- From: Chris O'C via AccessMonster.com
- Re: Are split databases a chimera of utility?
- From: Author
- Are split databases a chimera of utility?
- Prev by Date: Re: Drop down list box colour
- Next by Date: Any benefits of relating two un-directly related tables & queries?
- Previous by thread: Re: Are split databases a chimera of utility?
- Next by thread: RE: Are split databases a chimera of utility?
- Index(es):
Relevant Pages
|
Loading