- Dan Benson, Seattle, WA
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>...
Kerry Moorman <kmoo...@home.com> wrote in message
news:So%X3.2130$pY2.1...@news.rdc1.tn.home.com...
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
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
*******