Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
REPLACE command does not REPLACE....
Message
 
 
À
04/03/2008 10:44:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01298436
Message ID:
01298438
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Use REPLACE with IN clause. W/o it REPLACE will do nothing if current work area is at EOF.

>Why did this code not work when trying to use the REPLACE command to replace a field in a different alias than the current alias?
>
> SELECT SomeTableOtherThanMachineSched
> *-- Some misc code here
>
> REPALCE MachineSched.status with 'C' <------ (An updateable view)
> llUpdate=TABLEUPDATE(1,.t.,'MachineSched')&& update local view
> IF llupdate=.f.
> MESSAGEBOX('Error updating changes to data table in cmdCheck.click()', 0, 'Error')
> ENDIF
>
> *-- Requery local view
> cMachNo=thisform.mach_num && Required var for local view
> REQUERY('MachineSched') && to refresh data set
>
>
>
> Problem:
>
> The REPLACE with 'C' would not 'stick' until I specifically SELECTED the correct view alias first.
>
> This code did work:
>
> SELECT SomeTableOtherThanMachineSched
> *-- Some misc code here
>
> SELECT MachineSched
> REPLACE status with 'C' <------ (An updateable view)
> llUpdate=TABLEUPDATE(1,.t.,'MachineSched')&& update local view
> IF llupdate=.f.
> MESSAGEBOX('Error updating changes to data table in cmdCheck.click()', 0, 'Error')
> ENDIF
>
> *-- Requery local view
> cMachNo=thisform.mach_num && Required var for local view
> REQUERY('MachineSched') && to refresh data set
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform