P
Patrick Jackman
In Access DAO/Jet applications, I handle Master/Detail relationships by
using unbound fields for the Master table and a subform bound to a local
temp table for the Detail rows with OK, Apply and Cancel buttons on these
forms. If the user clicks OK or Apply, I do concurrency checks then I write
from the unbound fields to the Master table on the server and from the local
temp table to the Detail table on the server for rows that are new, dirty or
deleted. If the user clicks Cancel, I just close the form.
In some applications I have up to 5 Detail subforms against a Master without
any issues. Using temp tables allows me to validate business rules between
the various M/D entities before saving any changes. I also use
multi-instance forms to allow users to have multiple views of M/D data open
concurrently and I keep track of what data in a local temp table belongs to
which form instance by loading the subform's hWnd along with its data.
Using local temp tables for Detail entities and local tables for lookups
allows me to have acceptable performance with 20 - 25 concurrent users
against a 700 MB backend. This approach is code intensive but I've had time
to streamline it over the last 12 years of working with Access full-time.
I would like to start using SQL Server 2000. If I connect with ODBC I can
continue with the same design approach using local temp Jet tables. But I
would like to consider using ADPs to avoid the reported performance penalty
of ODBC.
Is there a "best practice" for Master/Detail form design with ADPs?
I've tried several approaches without success:
1. Bind ADO adLockBatchOptimistic recordsets to the Master and Detail forms
then set the ActiveConnection = Nothing. When I reconnect and issue
UpdateBatch, the M will update in certain situations but the D never
updates.
2. Create an in memory ADO recordset for the Detail, load it with data and
bind it to the Detail subform. The binding fails with #Error in each field
of the subform.
3. The "Access 2002 Enterprise Developer's Handbook" approach on p. 281:
"Using Transactions with Bound Forms". It works until I attempt to open a
second form instance on the same row while the 1st is still in a
transaction. And I've read posts here suggesting this is not a best
practice.
What is the preferred approach for dealing with this issue in ADPs? Has
anyone written about it from a real world perspective?
Patrick
using unbound fields for the Master table and a subform bound to a local
temp table for the Detail rows with OK, Apply and Cancel buttons on these
forms. If the user clicks OK or Apply, I do concurrency checks then I write
from the unbound fields to the Master table on the server and from the local
temp table to the Detail table on the server for rows that are new, dirty or
deleted. If the user clicks Cancel, I just close the form.
In some applications I have up to 5 Detail subforms against a Master without
any issues. Using temp tables allows me to validate business rules between
the various M/D entities before saving any changes. I also use
multi-instance forms to allow users to have multiple views of M/D data open
concurrently and I keep track of what data in a local temp table belongs to
which form instance by loading the subform's hWnd along with its data.
Using local temp tables for Detail entities and local tables for lookups
allows me to have acceptable performance with 20 - 25 concurrent users
against a 700 MB backend. This approach is code intensive but I've had time
to streamline it over the last 12 years of working with Access full-time.
I would like to start using SQL Server 2000. If I connect with ODBC I can
continue with the same design approach using local temp Jet tables. But I
would like to consider using ADPs to avoid the reported performance penalty
of ODBC.
Is there a "best practice" for Master/Detail form design with ADPs?
I've tried several approaches without success:
1. Bind ADO adLockBatchOptimistic recordsets to the Master and Detail forms
then set the ActiveConnection = Nothing. When I reconnect and issue
UpdateBatch, the M will update in certain situations but the D never
updates.
2. Create an in memory ADO recordset for the Detail, load it with data and
bind it to the Detail subform. The binding fails with #Error in each field
of the subform.
3. The "Access 2002 Enterprise Developer's Handbook" approach on p. 281:
"Using Transactions with Bound Forms". It works until I attempt to open a
second form instance on the same row while the 1st is still in a
transaction. And I've read posts here suggesting this is not a best
practice.
What is the preferred approach for dealing with this issue in ADPs? Has
anyone written about it from a real world perspective?
Patrick