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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaring Memory Vars 1

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
Should memory variables be declared?
I have scattered memvar but I am told that the first memory var is not available.

Keith
 
Do I need to set buffering in the form and the table?

Your choice. Personally, I prefer to do it at the table level (in the form's Load or Init), because that lets you choose between row and table buffering. If you do at the form level, you have to use row buffering (except for grids).

Do I have to turn buffering off to delete a record?

No. For this purpose, a deletion should be considered to be the same as an edit.

I tried a SELECT with the same SQL syntax and it finds the target record.

Keep in mind that SELECT works directly on the physical data, not on the buffered data (at least, that's its default behaviour). It is unusual in that respect. Almost all other commands are aware of the buffer. So, if you do a SELECT before you commit the data, it won't see the changes you have made. That might explain why it's not showing the deleted records. Try doing a browse to see if you can see the deletions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Remember TABLEUPDATE() without using any parameters works on the currently active workarea.
You don't select PAGES, DELETE FROM PAGES works on the PAGES table/alias, but also does not select it.

It would be better to be verbose about the parameterisation of Tableupdate to let it do what you want. Also you need to consider the case TABLEUPDATE returns .F.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top