Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Networking
Message
De
17/07/2001 04:30:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/07/2001 23:34:52
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00531343
Message ID:
00531404
Vues:
9
>Dear all,
>
>In my application, 2 programs are installed on 2 computers in sharing the same tables which located on one of the 2 computers. The computers are connected with LAN. By mapping the tables to a network drive z:, one of the program on the computer ComputerA (the workstation) which is about to access the tables on the other computers ComupterB (the server) by adding the command codes :
>
>thisform.dataenvironment.cursor1.database=z:\MyTable.DBC
>:
>:
>
>at the BeforeAutoOpenTable Event on each of the form of the computerA
>
>Additionally I set
>
>Set exclusive off at Load() Event and
>DataSession=2 at every forms on both of the computers(ComputerA/ComputerB).
>
>Afterward, Can I sucess to share the datas simultaneously on the two machiness?
>What else should I consider.
>
>Is deletion not support in sharing databases? i.e. I can not delete a record when the tables are opened shared .
>
>The case is urgent!
>
>Thank you for your kind attentions.
>
>
>With regards,
>
>Ransome

So,
set exclusive off
set multilocks on
For every datasession (and some other sets like century that are scoped to current datasession). You could put these in baseform load.
You can add, edit, delete in shared tables. How would you handle conflicts is up to you. There is a devoted chapter on this in online help (Programming for shared access or similar).
Next you don't need to change DE.cursor.database settings. In DE database path is hardcoded, however if VFP can't find that path it checks in set('path'). You can just set path to new data location (keep in mind to keep relative pathing between DBC and its tables. ie: if in your development machine mydbc.dbc and mytable.dbf are in different dirs than their relative pathing should be preserved). Also be sure it wouldn't find data in its local path. This is just like you have an exe with the same name in different dirs. Which would be called would depend on your pathing.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform