Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Questions re Bob Lee's article on MySQL
Message
From
29/03/2002 07:22:50
 
 
To
29/03/2002 00:12:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00638711
Message ID:
00638858
Views:
26
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform