Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data) 
Author Message
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)

I have a problem where a dynamic ADO recordset in my VB6 app does not
refresh as I expect it to.

If I have two instances of my program running (let's say on separate
machines), and a user updates a record, the other user does not see the
changes unless the recordset on the second machine is closed and reopened.

The code to open the recordset is as follows:

    Set rsClient = New ADODB.Recordset
    rsClient.Open "Client", cnFIS, adOpenDynamic, adLockOptimistic

This is an ADO recordset in VB6 running against an SQL Server 2000 database.

I had to use a client-side cursor in this case, since I make extensive use
out of the Sort and Filter recordset methods.

Isn't a dynamic recordset supposed to refetch record data every time that
the current record changes? How come that is not happening in this case?

Any help would be greatly appreciated.

Thanks,

Jack



Sun, 09 Jan 2005 08:58:36 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
Jack

For client side cursor, adOpenStatic is the only supported CursorType. Even
if  you specify some other type, it will default to adOpenStatic

HTH

Sukesh


Quote:
> I have a problem where a dynamic ADO recordset in my VB6 app does not
> refresh as I expect it to.

> If I have two instances of my program running (let's say on separate
> machines), and a user updates a record, the other user does not see the
> changes unless the recordset on the second machine is closed and reopened.

> The code to open the recordset is as follows:

>     Set rsClient = New ADODB.Recordset
>     rsClient.Open "Client", cnFIS, adOpenDynamic, adLockOptimistic

> This is an ADO recordset in VB6 running against an SQL Server 2000
database.

> I had to use a client-side cursor in this case, since I make extensive use
> out of the Sort and Filter recordset methods.

> Isn't a dynamic recordset supposed to refetch record data every time that
> the current record changes? How come that is not happening in this case?

> Any help would be greatly appreciated.

> Thanks,

> Jack



Sun, 09 Jan 2005 14:38:55 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
In such a case, is there any way that I can use a client-side cursor while
simulating the effect of a keyset or dynamic cursor?

Thanks,
Jack


Quote:
> Jack

> For client side cursor, adOpenStatic is the only supported CursorType.
Even
> if  you specify some other type, it will default to adOpenStatic

> HTH

> Sukesh



Sun, 09 Jan 2005 19:12:30 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
Jack

Not that I know of. Possibly, you could refresh/resync/requery the recordset
at regular intervals to see changes.

If one could do what you wish to do (client side cursor with dynamic or
keyset type),  then probably there would be very excessive overheads in
network traffic and would become possibly unmanageable in a multi-user
environment. It would be a mess. Imagine 100 simultaneous connections with
dynamic client side cursors.

May be some other ADO expert would comment on this.

Sukesh


Quote:
> In such a case, is there any way that I can use a client-side cursor while
> simulating the effect of a keyset or dynamic cursor?

> Thanks,
> Jack



> > Jack

> > For client side cursor, adOpenStatic is the only supported CursorType.
> Even
> > if  you specify some other type, it will default to adOpenStatic

> > HTH

> > Sukesh



Sun, 09 Jan 2005 22:33:06 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
The traffic would be excessive if requerying several rows every few seconds.
I use messaging to inform client applications of updates but I only do this
for "focused" records not for entire grids of data.

--
Mike Collier BSc (Hons) - www.adoanywhere.com
ADO Object Browser and COM Server.
Consultancy and Design - ADO & Database Specialists.


Quote:
> Jack

> Not that I know of. Possibly, you could refresh/resync/requery the
recordset
> at regular intervals to see changes.

> If one could do what you wish to do (client side cursor with dynamic or
> keyset type),  then probably there would be very excessive overheads in
> network traffic and would become possibly unmanageable in a multi-user
> environment. It would be a mess. Imagine 100 simultaneous connections with
> dynamic client side cursors.

> May be some other ADO expert would comment on this.

> Sukesh



> > In such a case, is there any way that I can use a client-side cursor
while
> > simulating the effect of a keyset or dynamic cursor?

> > Thanks,
> > Jack



> > > Jack

> > > For client side cursor, adOpenStatic is the only supported CursorType.
> > Even
> > > if  you specify some other type, it will default to adOpenStatic

> > > HTH

> > > Sukesh



Sun, 09 Jan 2005 23:28:28 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
Thank you all for your help.

I'm going to try converting to a server-side cursor. My main concerns would
be finding a substitute for my current code that calls the Filter and Sort
methods, in addition to figuring out how to use this recordset bound to a
grid.

Jack



Mon, 10 Jan 2005 00:10:09 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
Jack

1. Filter & Sort : You could do that while retrieving the records using SQL,
so your recordset is so much the more leaner. (Less overheads).

2. Is the Grid for viewing only or you use it update records too ?

Sukesh


Quote:
> Thank you all for your help.

> I'm going to try converting to a server-side cursor. My main concerns
would
> be finding a substitute for my current code that calls the Filter and Sort
> methods, in addition to figuring out how to use this recordset bound to a
> grid.

> Jack



Mon, 10 Jan 2005 00:18:08 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
The form has a grid and several text boxes all bound to the same recordset.
The grid is for viewing only (record selection), although the text boxes
allow editing. I am using the Apex True DBGrid.


Quote:
> 1. Filter & Sort : You could do that while retrieving the records using
SQL,
> so your recordset is so much the more leaner. (Less overheads).

> 2. Is the Grid for viewing only or you use it update records too ?



Mon, 10 Jan 2005 00:40:32 GMT  
 Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)
Jack

You can use MSHFlexGrid with server side cursor

Set MSHFlexGrid.DataSource=objRecordset

Sukesh


Quote:
> The form has a grid and several text boxes all bound to the same
recordset.
> The grid is for viewing only (record selection), although the text boxes
> allow editing. I am using the Apex True DBGrid.



> > 1. Filter & Sort : You could do that while retrieving the records using
> SQL,
> > so your recordset is so much the more leaner. (Less overheads).

> > 2. Is the Grid for viewing only or you use it update records too ?



Mon, 10 Jan 2005 01:49:51 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Dynamic ADO Recordset Not Dynamic (Does Not Refresh Data)

2. Tray tip not dynamic, how to refresh?

3. Q188858 Setting the Recordset's dynamic Command Timeout Property does not time out

4. ADO: Dynamic Recordsets with Persistent Data Problem

5. Problem with ADO 2.5 and dynamic cursors not updating

6. Dynamic reports not showing data

7. Dynamic Data Structures: Dynamic Arrays?

8. Data Recordset will not refresh

9. Dynamic (on Run Time) refresh of combo box data

10. Dynamic (on Run Time) refresh of combo box data

11. Creating ADO recordset w/o database .Append not working correctly IIS5 win2000 Prof not .Net

12. Dynamic source with ADO Recordset CR 8.5...

 

 
Powered by phpBB® Forum Software