473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ADP: How to handle work tables?

Seems like creating a #temp table is kind of useless because it cannot be bound
to a subform.

OTOH, seems like a waste of resources to populate work tables in the "real"
database - both because of server mips and the round-trip-for-nothing.

I'm thinking about a timesheet where data is stored in a three-table heirarchy:
TimeSheet==>TimeSheetLine==>HoursWorked. To present that to the user, the data
has to be pivoted into a temp or work table that shows a line for each project
and a column for each weekday. The user works on the pivoted presentation and
then, when it's time to save, the data is un-pivoted back into
Timesheet/TimeSheetLine/HoursWorked.

How about setting up a "tblTimeSheetPresentation" on the server but never
actually writing to it? Instead, the server table would just serve as a
marker/hook/tabledef and when the app "used" it, it would open up the table, cut
the connection, and then work with it locally - where I *guess* ADO
transparently maintains an XML dataset or arrays in memory or something... And
once the local data has been un-pivoted and saved, the disconnected recordset
would have all it's rows deleted..

Is this feasible? Seems like it would satisfy the ADP table-wise, but prevent
the wasted round-trips to the server...
--
PeteCresswell
Nov 12 '05 #1
3 2981
On Mon, 05 Apr 2004 09:42:04 GMT, Chuck Grimsby
<c.*******@worldnet.att.net.invalid> wrote:

#temp tables are always kind of a hack in SQL, Pete. They are
"expensive" in terms of resources and somewhat slow. There are also
times when there's no other choice but to use them, however #temp
tables really should be considered a last resort. Rather like using
Make-Table queries in Access and then deleting the table when it's use
is over or it's time to create a new table.

It's far more efficient in both Access and SQL to use a permanent
"temp" table and limit the records the user deals with to just those
that the user "owns" via the WHERE clause, or just use queries (views
and Stored Procedures in SQL) to get to the data.
Well, that's not the whole story with SQL Server. There's another expens you
may want to avoid, and that's space in the transaction log that must be backed
up if you are doing incremental backups. Levels of temporary data activity
can swamp permanent activity in many applications, meaning that the space it
ends up taking in the backup dwarfs the space required for just backing up
changes to permanent data.

One alternative I've used with MDB front-ends is to actually use batches of
temporary data in permanent tables with batch IDs, but put those tables in a
separate database using the simple recovery model, so that the transaction log
will not grow. A view in the primary database references the table in the
other database, so the application doesn't have to keep track of the
implementation. Unfortunately, due to the way ADPs break encapsulation, I've
never been able to make this trick work in an ADP.
And, of course, it's never a good idea to access a table directly in
any database. Always go through a query, view or stored procedure.


Again, with ADPs, you can indicate that you are using the view or stored
procedure, but ADO and Access will try to go around your back. You still get
the conceptual abstraction, but not true encapsulation. Using a view that has
the WITH METADATA option, you can actually get a view to work as
encapsulation, but with some significant limitations. I was not able to use
that to solve the problem above, for instance. Also, a WITH METADAT view will
report no or incorrect key information if multiple tables are involved.
That's OK with an MDB where you can assign a virtual primary key to a link,
but you can't do that in an ADP.
Nov 12 '05 #2
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:p3********************************@4ax.com...

#temp tables are always kind of a hack in SQL, Pete. They are
"expensive" in terms of resources and somewhat slow. There are also
times when there's no other choice but to use them, however #temp
tables really should be considered a last resort. Rather like using
Make-Table queries in Access and then deleting the table when it's use
is over or it's time to create a new table.
Temporary tables have two advantages though;

a) since tempdb is minimally logged less information is written to disk so
writes are somewhat faster,
b) you can locate tempdb on a separate physical drive, which can have a
marked improvement on performance
It's far more efficient in both Access and SQL to use a permanent
"temp" table and limit the records the user deals with to just those
that the user "owns" via the WHERE clause, or just use queries (views
and Stored Procedures in SQL) to get to the data.
And, of course, it's never a good idea to access a table directly in
any database. Always go through a query, view or stored procedure.
I don't agree with this Chuck - I think global work tables are going to
incur more overhead. If you consider that they are fully logged, plus the
cost of having to constantly query for each users records, no, I think a
true tamp table will win out, both in disk I/O and processor cycles. To make
the temp table updateable though you have to roll your own as it were. In
this case I would prefer to just fetch the records once and process them on
the client.
For "pivoted" information, disconnected recordsets are indeed best,
with behind the form updates to whatever table(s) are worked with.


I've started using local jet databases with adp's for these situations and
I've had great results. It's a lot more work, granted, especially managing
batch updates and handling multi-user conflicts, but the benefit of having
true relational capability client-side more than makes up for it. With
Access XP, (and I think 2000 as well), you can bind an updateable form to a
dao recordset created from a local jet database, so you really have the best
of both worlds.

We have an application where users can view a couple of hundred columns of
results, in pages of 10 columns at a time. The old system using server temp
tables was horrible; changing pages took several seconds - once we changed
to a local jet database it ran like lightning..
Nov 12 '05 #3
"John Winterbottom" <as******@hotmail.com> wrote in
news:c4*************@ID-185006.news.uni-berlin.de:
I've started using local jet databases with adp's for these
situations and I've had great results. It's a lot more work,
granted, especially managing batch updates and handling multi-user
conflicts, but the benefit of having true relational capability
client-side more than makes up for it. With Access XP, (and I
think 2000 as well), you can bind an updateable form to a dao
recordset created from a local jet database, so you really have
the best of both worlds.


But, heavens!!!! That means your ADP is not longer JETLESS!!!!!

HORROR OF HORRORS!!!!!!!!!!!!!

THE WORLD WILL COME TO AN END!!!!!!!

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dp | last post by:
After looking and looking, it appears that Access ADPs graphic query designer won't display: update customer set = . from customer, where customer. = .; It comes up with the "Query...
33
by: Jerry Boone | last post by:
A long time ago Larry Linson (MVP contributor to this group) made a point to me that mdb's could do anything ADP's (Access Projects) could by using linked tables to leverage Sql server databases. ...
3
by: (Pete Cresswell) | last post by:
Seems like creating a #temp table is kind of useless because it cannot be bound to a subform. OTOH, seems like a waste of resources to populate work tables in the "real" database - both because...
25
by: Neil Ginsberg | last post by:
A while back I posted a message re. using an ADP file with a SQL Server back end as opposed to MDB file with linked tables, thinking that the ADP file would be less problematic. The input I got was...
60
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I...
26
by: gabry.morelli | last post by:
Is it possible to create an .ADP application (in Access 2003) without having to connect SQL Server but using directly the tables and queries inside the .ADP file? Thanks
0
by: Mbam | last post by:
Hi all- I have an ADP that has worked fine for years. It is the front end for a web based shopping cart. I am now trying to clean up the database a bit and am separating all the static catalog...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.