Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving a value to multiple tables
Message
De
24/02/2010 12:20:10
 
 
À
24/02/2010 12:16:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01450770
Message ID:
01450794
Vues:
30
>>>>>Hello!
>>>>>im wondering about somethin. I have a clientID and it has a control source in a text box so when i save the client id gets saved in clients.clientid. im wondering is there a way i can send that to example books.clientid as well?like...give one text box 2 control sources?
>>>>
>>>>No, but you can do replace command in the textbox.InteractiveChange event (or in Valid event - may be better)
>>>>
>>>>replace ClientID with this.value in Books
>>>
>>>ah lemme try the top of my head again on this 1
>>>
>>>SELECT books
>>>SET order TO clientid
>>>SEEK globalclientid
>>>IF FOUND()
>>>replace books.clientID WITH clients.clientID
>>>ELSE
>>>ENDIF 
>>>
>>
>>You really should spend some time getting to learn the SQL commands. All this code can be replaced by ONE line if you use SQL syntax
>>Update books set clientID=clients.clientID where books.clientID=globalclientid
>
>welll.....i did SQL at scholl but not much...:D but thanks

SQL is usually faster and also safer than normal VFP code. And if you later plan to move your data to a real SQL server, most of the work is already done.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform