Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Synchronize VFP and SQL server using TimeStamp
Message
De
13/04/2004 22:05:50
Tan Eng Hong
Visual Solutions (M) Sdn Bhd
Bayan Lepas, Malaisie
 
 
À
13/04/2004 11:19:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00894297
Message ID:
00894646
Vues:
9
>Hi,
> I currently creating a sync program to sync between VFP database and SQL database. So far it works fine. I got 1 issue which I need help. For information I use timestamp to identify which record is the latest one. The issue occur when:
>1. There are 2 server hosting each database. Their server time may be different. How to sync the time?
>2. VFP database has its own client user interface and same goes to SQL database has its own client user interface. When client update a record it will take local client time. How can I get server time?
>3. What if 2 server in different timezone?
>
> Is there any solution besides timestamp to solve my issue? I really appreciate it if someone can help me solve this issues.
>
>Thanks
>
>Regards
>Tan Eng Hong

Heya Tan - TimeStamp is so atomic - if you get an exact match I'd be surprised, at least with SQL Server. There has to be something else that is useful for uniqueness of records, and so on. Usually PK, if the database was designed properly - but lets assume it wasn't, just for the moment.
What other columns uniquely identify a record ? Things like CUSTomer ID,
date last updated, etc etc.

2 servers hosting EACH database ? hmmmmmmm curiouser and curiouser.
you mean you have ONE database on ONE server, and that database instance is replicated at another server in another database? Yes? No ?

Typically synching data is done via replication services, and you can make a DTS package on each sql server that will replicate data.
You can ALSO encapsulate DTS from VFP and start any DTS you want , callable from VFP.

hth - mondo regards [Bill]
----
William Sanders, Electronic Filing Group
VFP WebHosting VFUG FundRaiser

Hi,
Thanks for your reply. For your info, I already done the sync where it only insert record if cannot find the record in either database, so will only enter the unique record. If the record is found, it only update whatever fields that have changes. The issue comes when i wanted to update where i dont know which record is the latest changes. Thats is y i need the timestamp.
Currently the SQL database and VFP database is located at different server. They have different structure as well. But i still need to sync between them which make it difficult. What ever changes toward SQL database must reflex toward VFP database. They have the same PK only that the field maybe different name. For example SQL database use cdepartmen but VFP database use cdepartment. There is also cases on datetime from SQL server to be convert into date for VFP database.
Can DTS do all these condition for me? Anyway I not very good in SQL server. Can I export DTS setting so that can be use for my other customer? Hope to get your reply soon. :D Thanks again.

Regards
Tan Eng Hong
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform