PC Review


Reply
Thread Tools Rate Thread

Binding a form to a disconnected recordset and making it capable to update such recordset

 
 
Yarik
Guest
Posts: n/a
 
      21st Nov 2006
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.

 
Reply With Quote
 
 
 
 
Larry Linson
Guest
Posts: n/a
 
      22nd Nov 2006
"Yarik" <(E-Mail Removed)> wrote

> (Perhaps, this is a question for the Microsoft support
> team - I hope someone from that team reads this forum.)


You can't count on anyone from Microsoft reading what you post in this
newsgroup. On occasion, some Microsoft employees do read and respond, but it
is not part of the job description for anyone in Microsoft (except maybe the
people who maintain the news server, I suppose), if I understand correctly.

As far as I know, and my knowledge on the subject is not vast, working with
disconnected recordsets really didn't mature until Access 2002. But, some of
that "maturity" could have been retrofitted in an Access 2000 Service Pack
or update.

Larry Linson
Microsoft Access MVP


 
Reply With Quote
 
aaron.kempf@gmail.com
Guest
Posts: n/a
 
      22nd Nov 2006
why, oh why-- do you need to bind a form to a recordset?

set the RECORDSOURCE

don't re-invent the wheel

-Aaron


Yarik wrote:
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot update a disconnected (and then re-connected) ADO recordset bound to Access 2003 form Yarik Microsoft Access Form Coding 6 2nd Mar 2007 12:03 PM
Binding a form to a disconnected recordset and making it capable to update such recordset Yarik Microsoft Access 2 22nd Nov 2006 02:18 AM
Form with Disconnected Recordset will not allow edits. =?Utf-8?B?S2V2aW5XQg==?= Microsoft Access Form Coding 1 20th Apr 2006 01:17 AM
Form with Disconnected Recordset, Will not allow edits. =?Utf-8?B?S2V2aW5XQg==?= Microsoft Access ADP SQL Server 1 19th Apr 2006 08:07 PM
disconnected recordset form rmanchu@gmail.com Microsoft Access Forms 1 4th Apr 2006 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 AM.