Y
Yarik
Hello everyone,
I've got three questions, closely related to each other...
(1) After a superficial research on subject and doing some quick
experiments, the first conclusion I've come to is that binding a form
to a disconnected recordset in MS Access 2000 is imposssible. Is that
correct? Or am I just missing some "magic spell" that would make it
work?
(2) It looks like it is possible to do that in MS Access 2003, though.
At least a simple experiment like this one
Private Sub Form_Open(Cancel As Integer)
Dim rs As ADODB.Recordset
Me.RecordSource = ""
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = CurrentProject.AccessConnection
.Source = "SELECT * FROM jobs"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
Set .ActiveConnection = Nothing <<<<<
End With
Set Me.Recordset = rs
End Sub
demonstrates that am Access 2003's form can not only display but also
update a disconnected recordset. So, I guess, my second question is:
assuming that there may be some pitfalls when binding a form to a
disconnected recordset, could anyone summarize his/her experience in
this area (for example, point out to any important quirks, if any, in
comparison with using "normal", connected recordsets)?
(3) Finally, while doing my preliminary research, I stepped upon an
interesting Microsoft's article (specific to Access 2000)
http://support.microsoft.com/kb/227053/EN-US/
and got somewhat confused by the problem reproduction code sample at
the end of this article: the article says that code sample is not
supposed to work (i.e. the form is not updateable), but when I tried
this sample with my installation of MS Access 2000, it turned out to
work perfectly. Is it possible that this "repro" fragment of the
article has been outdated (e.g. by a service pack or something), or is
it just a mistake? (Perhaps, this is a question for the Microsoft
support team - I hope someone from that team reads this forum.)
Thank you,
Yarik.
I've got three questions, closely related to each other...
(1) After a superficial research on subject and doing some quick
experiments, the first conclusion I've come to is that binding a form
to a disconnected recordset in MS Access 2000 is imposssible. Is that
correct? Or am I just missing some "magic spell" that would make it
work?
(2) It looks like it is possible to do that in MS Access 2003, though.
At least a simple experiment like this one
Private Sub Form_Open(Cancel As Integer)
Dim rs As ADODB.Recordset
Me.RecordSource = ""
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = CurrentProject.AccessConnection
.Source = "SELECT * FROM jobs"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Open
Set .ActiveConnection = Nothing <<<<<
End With
Set Me.Recordset = rs
End Sub
demonstrates that am Access 2003's form can not only display but also
update a disconnected recordset. So, I guess, my second question is:
assuming that there may be some pitfalls when binding a form to a
disconnected recordset, could anyone summarize his/her experience in
this area (for example, point out to any important quirks, if any, in
comparison with using "normal", connected recordsets)?
(3) Finally, while doing my preliminary research, I stepped upon an
interesting Microsoft's article (specific to Access 2000)
http://support.microsoft.com/kb/227053/EN-US/
and got somewhat confused by the problem reproduction code sample at
the end of this article: the article says that code sample is not
supposed to work (i.e. the form is not updateable), but when I tried
this sample with my installation of MS Access 2000, it turned out to
work perfectly. Is it possible that this "repro" fragment of the
article has been outdated (e.g. by a service pack or something), or is
it just a mistake? (Perhaps, this is a question for the Microsoft
support team - I hope someone from that team reads this forum.)
Thank you,
Yarik.