Re: Updating Access data using SQL / refresh time question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Victor Koch ("Victor)
Date: 03/10/04


Date: Wed, 10 Mar 2004 15:14:27 -0300

Hi Brad,

 In DAO is not necessary refresh cache, but you can set the bookmark after
call update method like this:

> rs.addnew
> rs.fields("Fld1") = some value
> rs.fields("Fld2") = some value
> rs.update

  rs.Bookmark = rs.LastModified

PD:

(don;t ask!), yeah ..., is better don;t ask

--
Víctor Koch From Argentina.
"Brad Pears" <bradp@truenorthloghomes.com> escribió en el mensaje
news:#6khrGsBEHA.2804@tk2msftngp13.phx.gbl...
> Thanks for that...
>
> How would one go about refreshing a DAO recordset?
>
> I have a mix of DAO and ADO (don;t ask!) in this project...
>
> Example...
> dim db as database
> dim RS as dao.recordset
> set RS = db.openrecordset("Table1")
>
> ...some code....
>
> rs.addnew
> rs.fields("Fld1") = some value
> rs.fields("Fld2") = some value
> rs.update
>
> ' here I want to refresh the recordset so that the loading of the listview
> has the most recent changes...
>
> ... code to refresh the dao recordset...
>
> call Loadlistview(rs)
>
> sub LoadListview(rs as dao.recordset)
> ...code to load from the recordset
> endsub
>
> How do I refresh the DAo recordset?
>
> Thanks,
>
> Brad
>
>
>
> "Victor Koch" <v i c t o r
(arroba)correo(punto)waldbott(punto)com(punto)ar>
> wrote in message news:%23DzcKtpBEHA.4080@TK2MSFTNGP09.phx.gbl...
> > Hi Brad, you must refresh Jet cache, after INSERT or UPDATE do it:
> >
> > strSQl = "update TABLE set field = " & fldValue
> > oconn.execute strSQL
> > Call RefrescarJet(oconn)
> >
> >
> >
> > Sub RefrescarJet(Base As ADODB.Connection)
> >     Dim JRO As New JRO.JetEngine
> >     JRO.RefreshCache Base
> >     Set JRO = Nothing
> >  End Sub
> >
> > Add Reference "Microsoft Jet and replication object ........." in your
> > project.
> >
> > --
> > Víctor Koch From Argentina.
> >
> >
> > "Brad Pears" <bradp@truenorthloghomes.com> escribió en el mensaje
> > news:OZOLidfBEHA.212@TK2MSFTNGP12.phx.gbl...
> > > I have something happening in my VB 6.0 app that is driving me
crazy....
> > (DB
> > > is Access 2000 )
> > >
> > > I have a listview on the screen containing records from a master
table.
> > The
> > > user is able to double click a listview item, which then gives them a
> > screen
> > > where they can modify data in the table.
> > >
> > > To update data, I use an SQL clause and simply execute it i.e.
> > >
> > > strSQl = "update TABLE set field = " & fldValue
> > > oconn.execute strSQL
> > >
> > > When the update is complete, I refresh the items in the listview. i.e.
> > > clear all listview items and reload them from the same table I just
> > > updated... ( I know I can simply redisplay the actual listview item I
> was
> > on
> > > but this isn't what I am doing right now)
> > >
> > > However, sometimes, upon return to the listview from teh update
screen,
> > the
> > > newly updated data does not show up - instead, the old data is still
> > there.
> > > Then if I exit the screen and come back in, voila, there are the
> changes!
> > > It appears the the changes are not being made to the table immediately
> > when
> > > updating. I have this problem with just about every listview I have
> where
> > > the user can update data.
> > >
> > > It does not happen all the time, just often enough for me to get calls
> > from
> > > the users occasionally asking "How come my changes aren't made?" Then
I
> > tell
> > > them they have been saved, just exit that particular screen, come back
> in
> > > and you'll see them...
> > >
> > > I have tried using a wait loop i.e. for i = 1 to 100000, next i etc..
to
> > let
> > > the db updates complete first before redisplaying the listview but
that
> > > doesn't seem to work either.
> > >
> > > Maybe the problem is more with the listview caching data ebehind the
> > > scenes???  I do not know how this control  works internally...
> > >
> > > Any help would be much appreciated...
> > >
> > > Brad
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: Updating Access data using SQL / refresh time question
    ... How would one go about refreshing a DAO recordset? ... code to refresh the dao recordset... ... >> I have a listview on the screen containing records from a master table. ...
    (microsoft.public.vb.database)
  • Re: Dynamic recordset
    ... to an ADO recordset, but so far as I know, that recordset will be ... to display the detail of the record selected in the listview. ... Then an update to the detail would have to refresh the ... recordset when that recordset is being used only by the single form. ...
    (microsoft.public.access.forms)
  • Re: LockWindowUpdate
    ... just set the visible property to false when ... :> I would like to use LockWindowUpdate to lock the refresh of a listview ... :> control so it doesn't flicker as multiple items are being added. ... :> have it set to refresh about every .66 seconds. ...
    (microsoft.public.vb.winapi)
  • Re: speed up fill listview
    ... Trouble is that the listview refreshes itself each time ... Look up LockWindowUpdate, switching off ... the refresh can improve performance. ...
    (microsoft.public.vb.controls)
  • RE: Refresh icon of ListView
    ... the imagelist which is associated with the listview, the listview picture ... to call the refresh will refresh all the item in the listview. ... Private Sub Button1_Click(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)