Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Questions re Bob Lee's article on MySQL
Message
De
29/03/2002 07:22:50
 
 
À
29/03/2002 00:12:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00638711
Message ID:
00638858
Vues:
25
Hi Peter,

Nearly all you asked for is doable. If you are using VFP7.0 you do not have to do anything special with the cursor to make it readwrite other than adding the "readwrite" attribute to the SQL statement. There does not seem to be a need to relate files because the cursor sets you have retrieved are already those which are associated with the Owners cursor, there are NO other records in the local cursors.
Form::Load

create cursor c_Owners ( iOWNERS (x)...)
create cursor c_Persons ( iOWNERS (x)...)
create cursor c_Address ( iOWNERS (x)...)
create cursor c_phones ( iOWNERS (x)...)
create cursor c_Email ( iOWNERS (x)...)
create cursor c_CrCard ( iOWNERS (x)...)
The following is not how I would implement this in my own system but it demonstrates how an existing application such as yours could be made to adapt to C/S.
Form::GetCursors

SqlExec(nMySQL,'select * from OWNERS where iOWNERS = '+ tiOWNER,'cOwners')
SqlExec(nMySQL,'select * from Persons where iOWNERS = '+ tiOWNER,'cPersons')
SqlExec(nMySQL,'select * from Address where iOWNERS = '+ tiOWNER,'cAddress')
SqlExec(nMySQL,'select * from Phones where iOWNERS = '+ tiOWNER,'cPhones')
SqlExec(nMySQL,'select * from Email where iOWNERS = '+ tiOWNER,'cEmail')
SqlExec(nMySQL,'select * from CrCard where iOWNERS = '+ tiOWNER,'cCrCard')

*
*  Since all controls are bound to Load event cursors
*  We must populate those cursors with the current data from the back end
*
select c_owners
zap
append from (dbf('cOwners'))

select c_Persons
zap
append from (dbf('cPersons'))

select c_Address
zap
append from (dbf('cAddress'))

select c_Phones
zap
append from (dbf('cPhones'))

select c_Email
zap
append from (dbf('cEmail'))

select c_CrCard
zap
append from (dbf('cCrCard'))
I don't know how to lock a current record in a client server scenario other than by begin transaction / end transaction, which I think could be used when handling your updates.

One of the only things not handled very well is full table browsing. It would be imprudent to use a grid or to use next prev for master record navigation. Client server is set orientated.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform