Re: ADODB.Recordset.Bookmark



Thanks for the info. I'm not really a beginner developer, just new to ADO
(been stuck using DAO for ever). I know about bookmarks _in_general_, but
can't seem to make 'em work for me with ADO.

I changed the cursor type to static, and bookmarks work, but now I can't
update the recordset. The first cursortype I tried (as I mentioned) was
dynamic (adOpenDynamic, to be precise). I'll look into the Supported()
function.

--
-Richard M. Hartman
hartman@xxxxxxxxxxxx

186,000 mi/sec: not just a good idea, it's the LAW!

"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:OIrkgMWMIHA.484@xxxxxxxxxxxxxxxxxxxxxxx

"Richard M. Hartman" <hartman@xxxxxxxxxxxx> wrote in message
news:e8nFUeVMIHA.280@xxxxxxxxxxxxxxxxxxxxxxx

How do you use this? I am trying, but getting an error that says that
the
recordset does not support them and that it may be the fault of either
the
provider or the cursortype. What I have not seen is anything telling me
what cursortype I should be using. The provider is MS SQL Server. I
have
tried the default cursortype and adOpenDynamic. Is there a method or
property of the connection or recordset that can tell me whether the
provider supports bookmarks? Are there any other tips that y'all can
offer?

TIA


In the spirit of teaching you how to fish, instead of just giving you a
fish
<g>
http://www.netzone.ch/caspdoc/Ch11_ADO101.html

To find additional values (if available) open the Object Browser [F2] and
search for CursorOptionEnum in the ADO library. After awhile of playing
around you will quickly find out what's available, under what conditions.

The Supports() member is handy during development where you can simply
type
it in the intermediate window.

adOpenDynamic - usually supports bookmarks (it supports all navigation) so
you might want to check out the provider or client/server side cursor.

=======

Admittedly most documentation and tutorials seem to give Bookmarks a
mystical quality.

The Recordset.Bookmark is a binary string which indicates the current
record. It is unique for every record in any given Recordset. While there
is
some rhyme 'n reason to the value - best to not go there. <g> Just think
of
them as "Tags".

The most common use of a Bookmark is to set the current record to a
variable, then after you have moved to another record you can always make
the original record the current one by setting it back to the captured
value.

Another use comes from when you updated a recordset. The bookmark holds
the
last/current record that has been 'touched'. So if you capture the
bookmark
in an update event you can later go back to updated record, again, using
the
saved bookmark.

You might also capture the bookmarks for interesting records while looping
through a recordset, store them in an array, then come back and do some
additional massage on those records.

Not only can you use Bookmarks directly but other methods and controls
also
use them. This is why Bookmarks, Find, and controls like a Grid are so
closely associated.

hth
-ralph






.



Relevant Pages

  • Re: ADODB.Recordset.Bookmark
    ... can't seem to make 'em work for me with ADO. ... I changed the cursor type to static, and bookmarks work, but now I can't ... Using a Recordset, are you sure you have an updateable one? ...
    (microsoft.public.vb.database.ado)
  • Re: ADODB RECORDSET Optimierung
    ... Recordset mit einem Static Cursor öffnest? ... Damit zwingst Du ADO die ganze Tabelle in den Speicher einzulesen und eine Kopie aller Records anzulegen. ...
    (microsoft.public.de.access.clientserver)
  • Re: ADO Data Control Concurrency Problem
    ... >> Editing of row in table is done with the help of ADO Data Control. ... Cursor location does not bare on whether the ... Client or Server memory. ... reflected in the open recordset. ...
    (microsoft.public.vb.general.discussion)
  • Re: Zeilen im Datagrid bewegen
    ... Was kannst Du wie beim DG zur Entwurfszeit mit dem ADODC bearbeiten? ... > datagrid.rebind die bookmarks wieder löscht. ... Datensatz machen. ... solange das Recordset nicht neu geladen wird. ...
    (microsoft.public.de.vb)
  • Grids on form with Private Datasession and 3 tier application
    ... like to display a recordset in a grid on my form. ... am on the verge of just coding the data access straight into my grid control ... Is my best option ADO or another idea? ... will accept ADO as a recordset or do I have to convert it back to a cursor? ...
    (microsoft.public.fox.programmer.exchange)