Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Networking my application

Status
Not open for further replies.

EricDraven

Programmer
Jan 17, 2002
2,999
GB
Hi all,

I have written an application which uses a shed load of tables which I now need to make networkable. I have set up the system so that it all points to the one set of tables on the server as is the norm but my problem is this. I cant seem to make the workstation machines synchronise properly due to the way they use the tables. For instance, to search through a huge list of records they can filter the customers table by certain criteria until they narrow it down enough to see the record they want in a DBGrid. This works great, but what if somebody on another workstation is just saving a new customer, or another workstation is wanting to filter the table in a different way? At the moment the app is set up using the BDE and standard TTable and datasource components (not sure if this is the best way) using DBF files. Any advice, pointers etc would be most greatful?

Your friend Eric Draven Arte Et Labore
 
Place a Timer on your Form or Datamodule.
Set the Intervall to 10000 (10 sec) (or whatever time you want)
and refresh all you tables in the OnTimer event:

...
table1.refresh;
table2.refresh;
...

This have no influence on the filter criteria.
Your dbGrids are also refreshed automatically and changes from other users are displayed.

 
Don't think Refresh is that reliable, especially on TQueries. You'd be better to close and reopen the appropriate DB components.

lou
 
Is there an easy answer to this problem?

We had about the same problem, but we solved it with use of an central table where we updated "when and what"...

In other words. When a user updated a table, we added a record in the table, and whenanother user had to access the table, he had to access the central table first to locate if changed had been made...

But the sad this with this, is that when you for example updated one large table. The other client had to Re-open the query...


/Nordlund
 
Okay then, Ill change my question slightly.

Supposing I have a server and 5 workstation machines, if a table is opened by one workstation, does that then mean that none of the other machines can access that table until the workstation closes the table ending the connection?

Youll have to excuse my ignorance on this matter given that I aren't currently on a network because ours is in the process of being upgraded and I really need to get this working properly! Arte Et Labore
 
This is DBase isn't it? I haven't used it. Does DBase normally lock entire tables when they're being accessed?


 
Running a test with several applications using the one DBase table on my machine seems to work okay with no table locking.

Can anybody suggest a better way of using a database across a network? Arte Et Labore
 
Firstly, wouldn't it be better to use a series of TQueries? You could have some that manage the criteria and then a main one that does a query using the criteria.

Then, as Nordlund suggested, have a 'control' table which contained the tablename, recordID, the user who has locked the rows and the datetime when they were locked - just in case the user's pc crashed with the lock in place - check if the lock has 'expired' and remove it. If another user wants to view the same set of data, issue a message and ask if they want to view anyway. The app could even monitor when a specified set of data is released for the other user if the user wants that.

I'd also have different screens or Tabs(eg pagecontrol) for the different types of queries on the database.

Does this help at all?
lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top