Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Multi-User environment with bound data controls

34 views
Skip to first unread message

Dan Benson

unread,
Nov 14, 1999, 3:00:00 AM11/14/99
to
Is there any way around the problem of not being able to have multiple users
accessing an Access database with a VB front-end, doing multiple addnew
and/or edit over a network? It seems that using data-bound controls, the
whole database is basically locked for new record additions or edits. I
have had to force users to log out of the program so that another might make
changes. I have tried to set the Access database record-lock properties
different ways to work around this, to no avail. I thought Access would
just lock the current record, and/or the adjacent records when editing
functions were being carried out. Do I need to use DAO in an environment
like this? Help! I have a network full of users who need to be able to have
concurrent access to the program.

- Dan Benson, Seattle, WA

Kerry Moorman

unread,
Nov 15, 1999, 3:00:00 AM11/15/99
to
Dan,

I think you should be able to use the data control in a multiuser
environment.

You need to set the data control's Recordset's LockEdits property to False.
You should also set the data control's Options property to dbSeeChanges.
For example, in form_load:

Data1.Options = dbSeeChanges
Data1.Recordset.LockEdits = False

Then when updating records you need to use an error handler and handle error
3197 - Data has changed and errors 3186 and 3260 - Locked record. There are
many ways to handle these errors. An example:

UpdateError:

Select Case Err.Number

'Data has changed
Case 3197
MsgBox "Current Record has been changed by another user. Re-apply
your changes.", vbCritical, "Data has changed!"
'refresh and re-display the current record
Data1.Recordset.Bookmark = Data1.Recordset.Bookmark
Exit Sub

'Locked record at edit or update
Case 3186, 3260
response = MsgBox("Can't Update. Record Locked by another user.
Continue trying?", vbYesNo + vbCritical, "Locked")
If response = vbYes Then
'try the update again
Resume
Else
'give up and exit
Exit Sub
End If
'Unanticipated error
Case Else
MsgBox Err.Number & Err.Description, vbCritical, "UpdateError"
Exit Sub

End Select

Hope this helps,

Kerry Moorman

Dan Benson wrote in message <_zKX3.753$54.2...@news.uswest.net>...

Dan Benson

unread,
Nov 16, 1999, 3:00:00 AM11/16/99
to
Thank you so much Kerry, I will try this immediately. You're a gem!

Kerry Moorman <kmoo...@home.com> wrote in message
news:So%X3.2130$pY2.1...@news.rdc1.tn.home.com...

Christian Kanhäuser

unread,
Nov 17, 1999, 3:00:00 AM11/17/99
to Dan Benson
It is not a good idea using data bound controls for larger programs or
mulit-user programs.
Best example for this is the new DAO 3.6 which supports Access 2000.
Under VB6 you have troubles using DAO 3.6 with data bound controls.

So if you want to make a mulit-user program use dataclasses and fill
your forms with them. Do not use the direct way with data bound
controls. If your program gets larger and larger and you have to make
updates or use a new databaseformat you only have to change the
databaseclasses. If you use databound controls it could be happen, that
you must change and check every!!! form, or you have big troubles (like
using DAO 3.6).

MfG
Christian Kanhäuser

Jesús M. NAVARRO

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to
Hi Christian:

Christian Kanhäuser <c.kanh...@gmx.at> escribió en el mensaje de noticias
3832F7...@gmx.at...


> It is not a good idea using data bound controls for larger programs or
> mulit-user programs.
> Best example for this is the new DAO 3.6 which supports Access 2000.
> Under VB6 you have troubles using DAO 3.6 with data bound controls.
>
> So if you want to make a mulit-user program use dataclasses and fill
> your forms with them. Do not use the direct way with data bound
> controls. If your program gets larger and larger and you have to make
> updates or use a new databaseformat you only have to change the
> databaseclasses. If you use databound controls it could be happen, that
> you must change and check every!!! form, or you have big troubles (like
> using DAO 3.6).
>

...but those two things are not incompatible. You can use databound
controls and bound'em to your data classes.
--
SALUD,
Jesús
*******
e-mail: jesus_...@geocities.com
*******


0 new messages