Re: SQL updates to Access db table taking their time...

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

From: Val Mazur (group51a_at_hotmail.com)
Date: 03/11/04


Date: Wed, 10 Mar 2004 22:28:27 -0500

Hi Brad,

Are you using Access database? If yes, then Jet caches changes to the
database in local memory for 5 seconds and you will not see those changes
right away. See next KB about how to avoid this issue

http://support.microsoft.com/default.aspx?scid=kb;en-us;200300

-- 
Val Mazur
Microsoft MVP
"Brad Pears" <bradp@truenorthloghomes.com> wrote in message 
news:upm92ifBEHA.2632@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
>
> (oconn is an ADODB connection)
>
> 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 the 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 behind the
> scenes???  I do not know how this control  works internally...
>
> Any help would be much appreciated...
>
> Brad
>
> 


Relevant Pages

  • Re: Read data from Access databas
    ... > I use this code to get data from a Access database and put it in a ... > l: TListItem; ...
    (borland.public.delphi.database.ado)
  • Read data from Access databas
    ... I use this code to get data from a Access database and put it in a Listview: ... l: TListItem; ...
    (borland.public.delphi.database.ado)
  • Updating Access data using SQL / refresh time question
    ... I have a listview on the screen containing records from a master table. ... clear all listview items and reload them from the same table I just ... (I know I can simply redisplay the actual listview item I was on ... Then if I exit the screen and come back in, voila, there are the changes! ...
    (microsoft.public.vb.database)
  • SQL updates to Access db table taking their time...
    ... I have a listview on the screen containing records from a master table. ... clear all listview items and reload them from the same table I just ... (I know I can simply redisplay the actual listview item I was on ... Then if I exit the screen and come back in, voila, there are the changes! ...
    (microsoft.public.vb.database.ado)
  • refresh listview
    ... I want to refresh a listview when I add or delete a record from an access database. ... my lisview is name lvall so when I type lvall.refresh or lvall.update it does not work. ...
    (microsoft.public.dotnet.framework)