Top Banner
Multi-user Databases with Microsoft Access A Presentation for the Microsoft Access SIG of the North Texas PC User Group and the Metroplex Access Developers by Larry Linson . © Copyright 2000, 2001 by L.M. Linson, all rights reserved
34

Developing Multi-User Microsoft Access Database Applications

Mar 11, 2015

Download

Documents

ganira
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Developing Multi-User Microsoft Access Database Applications

Multi-user Databases with Microsoft Access

A Presentation for theMicrosoft Access SIG

of the North Texas PC User Group and the Metroplex Access Developers

by Larry Linson.

© Copyright 2000, 2001 by L.M. Linson, all rights reserved

Page 2: Developing Multi-User Microsoft Access Database Applications

What is Access?

u “A nice little desktop database”

u First popular Windows database

u For the novice u For the power useru For the developeru A File Server database with Jet

Page 3: Developing Multi-User Microsoft Access Database Applications

Access can build

u A standalone database

u A multi-user database

u A client linked to ODBC databases u A direct client to SQL Serveru A web interface to database

Page 4: Developing Multi-User Microsoft Access Database Applications

Multiuser Database

u Access Application Part

u Access (Jet database engine) Tables and Data

u On a Network

(for this discussion)

Page 5: Developing Multi-User Microsoft Access Database Applications

Performance Factors

u Hardware Environmentu Software Environmentu Network Environmentu Requirements of Applicationu Design of Application

u Implementation of Application(More details about these, later)

Page 6: Developing Multi-User Microsoft Access Database Applications

How Many Users?

u High-End Reports– Michael Groh – 150– Drew Wutka – 135 – Michael Kaplan – 90 +– Stephen Forte – 95

u Concensus– Almost every factor “just right”

Page 7: Developing Multi-User Microsoft Access Database Applications

How Many Users?

u “Routine” Reports– in comp.databases.ms-access newsgroup

– from experienced Access developers

– 30 - 70 users for Access 97 and Access 2000, a few less for Access 2.0

u Concensus– Not every factor has to be “just right”

Page 8: Developing Multi-User Microsoft Access Database Applications

How Many Users?

u Low -End Reports– Falls over with 4 users

u Concensus– At least one factor “very wrong”– Often many factors “wrong”

u Most common cause, when one proved– Designer / implementer did not understand

Microsoft Access

Page 9: Developing Multi-User Microsoft Access Database Applications

Resources . . .

u Access 97 Developer’s Handbook

u by Getz, Litwin, Gilbert

u published by SYBEX u ISBN: 0 - 7821 - 1941 - 7u Chap 12 – Developing Multi-User

Applications

Page 10: Developing Multi-User Microsoft Access Database Applications

Resources . . .

u Access 2000 Developer’s Handbook, Volume 2: Enterprise Edition

u by Getz, Litwin, Gilbertu published by SYBEX u ISBN: 0 - 7821 - 2372 - 4u Chap 2 – Developing Multi-User Jet

Applications

Page 11: Developing Multi-User Microsoft Access Database Applications

Resources . . .

u Programming Microsoft Access 2000

u by Rick Dobson

u publisher Microsoft Press u ISBN: 0 - 7356 - 0500 - 9u Chapter 10 – Working with Multi-

User Databases

Page 12: Developing Multi-User Microsoft Access Database Applications

Resources . . .

u Building Applications with Microsoft Access 97

u Manual, comes with Office Developer or the MSDN Library

u publisher: MicrosoftuChapter 10 – Creating Multi-User

Databases

Page 13: Developing Multi-User Microsoft Access Database Applications

Resources

u Microsoft Office Visual Basic Programmer’s Guide

u Manual, comes with Office 2000 Developer or the MSDN Library

u publisher: MicrosoftuChapter 16 –Multi-User Database

Solutions

Page 14: Developing Multi-User Microsoft Access Database Applications

What’s Different?

uUsing database across network– File-Server versus Server Databases– Performance– Corruption

u Multiple users of same data– Collisions (Add and Update) – Locking– Seeing Other Users Update – Refreshing– Updating Related Tables – Transactions– Who Am I? – Identifying Users

Page 15: Developing Multi-User Microsoft Access Database Applications

Multi-user Layout . . .

DATAON

SERVER

PROCESSON USER

WORKSTATION

PROCESSON USER

WORKSTATION

. . . PROCESSON USER

WORKSTATION

Page 16: Developing Multi-User Microsoft Access Database Applications

Alternate Layout . . .

DATA

PROCESS

PROCESS

PROCESS

USER

USER

USER

NT ServerRemote

MTS

Page 17: Developing Multi-User Microsoft Access Database Applications

Multi-User Layout

u Tables on Server– Available To All Users

u On Users’ Workstations– Access (or Runtime)– Application Part– Fetch .DLLs, Objects Locally

Page 18: Developing Multi-User Microsoft Access Database Applications

Access is a File-Server

u Retrieval, Extraction, and Manipulation on User’s Workstation

u Every I/O Done Across Network– That would normally be to local hard drive

– Not whole database, nor necessarily whole table

– Just what Access finds necessaryu Index may be enough to find exact records

Page 19: Developing Multi-User Microsoft Access Database Applications

Performance Factors

u Hardware Environmentu More Memoryu Faster Processorsu Faster Hard Drives

u Software Environmentu Not Too Much Else Running

u Network Environmentu Faster is Better

Performance

Page 20: Developing Multi-User Microsoft Access Database Applications

More Factors

u Reduce Network Traffic– Database Design

u Appropriate indexing more important u Use Queries not Tables

u No extra Tables in Queries

– Database Implementationu Queries, not DAO Code (When Feasible)u Queries, not RecordsetClone.FindFirst

Performance

Page 21: Developing Multi-User Microsoft Access Database Applications

Record Locking . . .u In Bound Forms

– No Locks (aka Optimistic Locking)» Only in the instant the record is saved

– Edited Record (aka Pessimistic Locking) » As soon as user begins to edit

– All Records» All records in the entire recordset» Batch Updates» Administrative Maintenance

Data Integrity

Page 22: Developing Multi-User Microsoft Access Database Applications

Record Locking . . .u Possibilities by Object

– All Three Options» Table datasheets; Select, Crosstab, Union

Query, Forms, OpenRecordset

– Lock Edited Record or All Records » Update, Delete, Make-Table, Append

– Lock All Records » Data Definition Queries

– No Locks or Lock All Records» Reports

Data Integrity

Page 23: Developing Multi-User Microsoft Access Database Applications

Record Locking . . .

u Default Record Locking Option– Established by menu Tools | Options

u Applies to All, Except– Data Definition Queries – All Records– Open Recordset – Edited Record

Data Integrity

Page 24: Developing Multi-User Microsoft Access Database Applications

Record Locking . . .u OpenRecordset

– dbDenyRead or dbDenyWrite– Overrides .LockEdits property– Native Access Tables Only

u .LockEdits Property– True = Edited Record (the default)– False = No Locks

Data Integrity

Page 25: Developing Multi-User Microsoft Access Database Applications

Record Locking . . .u Advantages of Pessimistic Locking

– Simple to Develop, Prevents Overwriting

u Disadvantages of Pessimistic– Lock Multiple Records, Less Concurrency

u Advantages of Optimistic Locking– Simple to Use, Better Concurrency, Less

Lockout

u Disadvantages of Optimistic– Can be Confusing to User, Allows Overwriting

Data Integrity

Page 26: Developing Multi-User Microsoft Access Database Applications

Record Locking

u Generally, use Optimistic– Minimize User Lockout

u Or, Mixed, by Specific Object– Most Optimistic, but– Critical Information, Pessimistic

» Example: Quantity on Hand in Inventory

Data Integrity

Page 27: Developing Multi-User Microsoft Access Database Applications

Locking Improvementsu Access 2.0

– Page Locking, Adding Locked Last or New Record

u Access 95, 97– Page Locking, but Adding Doesn’t Lock

Last or New Record

u Access 2000– Record-Level Locking, Optional

Data Integrity

Page 28: Developing Multi-User Microsoft Access Database Applications

Transactions

u Changes in a batch

u All Succeed or All Failu Same or Related Tables

– Credit New Account and Debit Old Account

– Allocate Stock to Order, Deduct Stock on Hand

Data Integrity

Page 29: Developing Multi-User Microsoft Access Database Applications

Causes of Corruptionu Ungraceful Termination

– Power Outages– Users Power-Off– Flakey Network

u Countermeasures– Battery Back-Up– Condition of Continued Employment– Isolate Cause and Replace

» Hardware» Staff

Data Integrity

Page 30: Developing Multi-User Microsoft Access Database Applications

Identifying Users

u Typically secure the database– Everyone Logs In

u Viewing and Reporting– MSLDBUSR.DLL by Microsoft

– Unsupported

Miscellaneous

Page 31: Developing Multi-User Microsoft Access Database Applications

Advanced Multi-User

u Stretch the Capacity

u “Unusual” Requirementsu Standard Approach Insufficient

u Threshold by Trial and Error

Page 32: Developing Multi-User Microsoft Access Database Applications

Advanced Multi-User

u Unbound Forms

u Code / Queries u Hold record minimal time

u Other approaches

Page 33: Developing Multi-User Microsoft Access Database Applications

Advanced Multi-User

u Buys a little time (at best)

u Consider “upsizing” u Often non-trivial project

– to extend multiuser application– to upsize to client-server

Page 34: Developing Multi-User Microsoft Access Database Applications

The End

Multi-user Databases with Microsoft Access

.

© Copyright 2000, 2001 by L.M. Linson, all rights reserved