Sync databases

Sync databases

Postby Jeff Barnes » Thu Oct 14, 2010 2:37 pm

Hi,

I have an older application that was never intended for networking ...
Now I have customers that would like to have more than one pc running my app but have the data the same on all pc's

Can anyone please suggest some ideas as to how I could accomplish this?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Sync databases

Postby James Bott » Fri Oct 15, 2010 1:17 am

Jeff,

I'm afraid you will have to rewrite it to be multiuser.

I learned a long time ago to always write multiuser apps--they still work with one user and they are no more difficult to write if you have the needed classes.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sync databases

Postby José Luis Sánchez » Fri Oct 15, 2010 6:16 am

James,
Can you post or explain how work your classes to write multiuser apps.
Regards,
José Luis
User avatar
José Luis Sánchez
 
Posts: 556
Joined: Thu Oct 13, 2005 9:23 am
Location: Novelda - Alicante - España

Re: Sync databases

Postby Jeff Barnes » Fri Oct 15, 2010 12:02 pm

Hi James,

I hear you ... I too learned that lesson. Unfortunately this app was before that lesson :(
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Sync databases

Postby James Bott » Fri Oct 15, 2010 3:15 pm

José,

Can you post or explain how work your classes to write multiuser apps.


The main issue is database access--record locking. This can be handled using TDatabase or my enhanced TData class. Then you always open data files in shared mode and always lock records for updating. These classes contain all the code to allow you to do this with minimal programming effort. For example with my TData class and a small subclass, you can do:

oCustomer:= TCustomer():new()
oCustomer:seek( cCustNo )
oCustomer:phone:= "999-999-9999"
oCustomer:save()
oCustomer:end()

The above code is completely multiuser. It also has built-in automatic retrys if the record is busy during an attempted save.

Another useful class is a user class. This allows you to store and retrieve user security and preferences.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sync databases

Postby George » Sun Oct 17, 2010 7:22 pm

Anyone has some experience using Tdata Class with ADS/ADT
I mean if we can use all Tdata power with Advantage Database Server ADT extension, instead of DBF.

Regards


George
George
 
Posts: 725
Joined: Tue Oct 18, 2005 6:49 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 107 guests