Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Flush
Message
From
09/11/2007 05:59:04
 
 
To
09/11/2007 02:52:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Flush
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01267840
Message ID:
01267886
Views:
15
>On Save Button, I use FLUSH FORCE command as
>
>select avlbook
>seek thisform.text1.value
>if !found()
>	append blank
>	replace date with thisform.text14.value
>	replace gate_no with thisform.text1.value
>endif
>
>select avlbook
>go top
>append blank
>delete
>pack
>flush force
>
>
>Is it true way or I should change codes

This code is wrong. You do not need to append a blank record and then delete that. Just use the following:
select avlbook

if !seek( thisform.text1.value )

	append blank
	replace ;
          date    with thisform.text14.value, ;
	  gate_no with thisform.text1.value

endif

pack   && this is not a good idea

use    &&  close the table

flush force   
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform