Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tablerevert() won't behave
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01087401
Message ID:
01087418
Views:
13
Hi Pascal
If you do the count in another work area, the record pointer will still move in the table, regardless if it's reused in a different work area (because your still dealing with a single physical table). Your better off with Dave's advice and using optimistic table buffering.



>Good insight Frank!
>
>That might be it, 'cuz I have to verify that the new user_ID provided for the new record (in the users table, as a matter of fact) doesn't already exist, so I do a count for id_user = newID, but in another workarea, like so:
>
>
>
>&&llCree is a form-level public variable indicating that the user is creating a new record...
>IF NOT llCree
>    IF LASTKEY() = 27
>&&traps 'escape' key to be able to proceed with the cancel property of my quit button
>	RETURN .T.
>    ELSE
>	IF EMPTY(this.Value) &&no username specified
>	    mssErr("Veuillez indiquer l'identificateur de l'usager.")
>	    RETURN .F.
>	ELSE
>	    lcAlias = ALIAS()	
>	    USE usagers AGAIN ALIAS us IN 995
>	    SELECT us
>	    COUNT FOR ALLTRIM(id_user) = ALLTRIM(this.Value) TO liResul
>	    USE IN 995
>	    SELECT &lcAlias
>	    IF liResul > 0
>		mssErr("Cet identificateur est déjà utilisé par un autre usager, veuillez en choisir un autre.")
>		RETURN .F.
>	    ELSE
>		RETURN .T.
>	    ENDIF
>	ENDIF
>    ENDIF
>ELSE
>
>that code is in the valid event of txtID_user.
>
>after verification in the debugger, the pointer doesn't move, in the concerned workarea, at least... Are the changes commited if I change the current workarea?
Previous
Reply
Map
View

Click here to load this message in the networking platform