Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UpDate On Table - Bug .. at Least for Me

Status
Not open for further replies.

PeterWallace

Programmer
Apr 28, 2003
210
0
0
AU
I have a few forms that display data in Grid .....

There s an Option to Delete a row

However where I have taken shortcut of
DELETING Record from Table and simply reloading the grid ... Often the Deleted record STILL shows ....

I have put in a WAIT A BIT 1 sec routine, after Closing The Table, and Then Reload the Grid from the table... This works


But Irritates me A> I have to pause The Updated Table and B> How do I get a PAUSE of Less than A Second ...

Peter Wallace
 
Perhaps if you let the grid do the magic for you, rather than trying to take this shortcut ..(you are getting caught out by Jet's caching algorithms, and whilst it is possible to muck around with these, e.g. assuming data sourced from data environment:

Code:
[blue]DataEnvironment1.Connection1.Properties("Jet OLEDB:Flush Transaction Timeout") = 0[/blue]

it isn't advised
 
I find that if I simply select any other row after deleting, it always stores the deletion or change of data.
Refresh doesn't always work instantly as strongm says.
I always make the grid or form invisible and execute a Moveprevious or Movenext if at record 1 when I close the form or grid in case I forget.

Usually I connect grids in code rather than a data type control and closing it and reopening always ensures changes take effect.
 
I have found a bigger bugbear

I fill a table with data ( from several other Tables ) ..i,e, It is a ledger of Months Transactions

The Table is then closed and Next step in process is to use The Data Report to print the Report ... Via Datashape

When I run it ,,,, NO Detail Lines show in he report ... ( these are from The Table I just Filled )

When I debug and step through ,,, come time to pop up the table on screen ...All detail Lines are displayed ....

Debug or No ... can look at the Table after creation and It holds all the data

Perhaps If I close the connection at same time as close Table it may solve

I have let grids *do the Majic* and works ... but as said I found this when using option to delete One or Maybe 2 lines from a grid that will never have more than 5 options ,,,

( All Options at Start ... but can remove some ... but Not Add )

 
I too used to have similar trouble using tables to enter data or filling the datagrid cells by code so I gave away doing that.
I find it is far more reliable and in the end easier using Dynaset Recordsets with a Criteria statement to enter data from text boxes or transfer data between tables and I usually only use the datagrid to view or browse data or edit one or two cells or one row at a time.

Its easier to program when you get the hang of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top