?
Solved

Lock Paradox Table

Posted on 2000-04-24
12
Medium Priority
?
478 Views
Last Modified: 2010-04-04
Dear Experts, please help !
        How can we lock paradox table explicitly in a network environment ?
Thanks from apin
0
Comment
Question by:pc_melsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 2743795
Open it for exclusive.
TTable.Exclusive:=true;
-----
Igor.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2744143
yup, thats it ;-)
just to remark:
set the exclusive-property to true before opening and use
open between a try except block, because the table could be opened
shared or exclusive by another user, which causes that the open fails.
0
 

Author Comment

by:pc_melsa
ID: 2746105
The problem is, if I set the exclusive property to true, another user will fail to share the table. ( they can't even read the table )
Anyway, thanks for the comments !

Best Regards.
apin
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:kretzschmar
ID: 2746282
hi pc_melsa,

? what wants you ?
lock a table locks the table for other users!
if you want to lock a record, then you've nothing to do as to set the table into edit-state, if the record you want to lock the current record.

meikl
0
 
LVL 1

Expert Comment

by:bozo7
ID: 2749432
meikl is right.
However you do need to make sure that all the users share a netfiledir.

Happy Coding,
Ross
 
0
 

Author Comment

by:pc_melsa
ID: 2758654
Sorry Mr Meikl, the question should be :
When I'm using xbase language in network environment, I can use Flock() to lock and edit the table, while the other users just only can read the table.
Can I do the same with paradox table ?

Thanks from apin
0
 
LVL 1

Expert Comment

by:bozo7
ID: 2759151
Yes you can. If the users share the same netfiledir when the table is put into edit mode the record is locked and all other users can read the record and the rest of the table.

Ross
0
 
LVL 1

Expert Comment

by:bozo7
ID: 2759172
To set the netfiledir use the following code:

session.NetFileDir := 'network drive';
forcedirectories('local drive');
session.PrivateDir := 'same local drive';

Ross
0
 

Author Comment

by:pc_melsa
ID: 2759856
Dear Mr. Ross, thanks for your comment !
      I use Netware 4.2 ( Dos Mode ) as my server operating system, and I put my executable file and table in one directory ( F:\delphi ). I've mapped search this directory, so the files can be shared by all users in their workstation ( using Windows 98 and add shortcut in the desktop ).

My question is :
1. How to make the netfiledir ? Does it ASCII file with no extension ?
2. Since I'm not using local drive, should I add the line 2 and line 3 in the netfiledir ? ( Forcedirectories() and Privatedir )

Thanks from apin


      
      
0
 
LVL 1

Expert Comment

by:bozo7
ID: 2760259
The way that I have done it in the past when the exe is on the network is like this:

forcedirectories(extractfilepath(application.exename)+ '\net');
Session.NetFileDir := extractfilepath(application.exename)+ '\net';
forcedirectories('local drive');
session.PrivateDir := 'same local drive';

This way the netfiledir is always right off the exe and all users will use the same directory. Even if you move the exe it won't be a problem.

Ross
0
 
LVL 1

Accepted Solution

by:
bozo7 earned 300 total points
ID: 2760282
Your second question:
The PrivateDir is where Paradox tables store temporary .sql files (created when a query is ran). This directory can't be shared by all users because they will step on eachothers toes if they do.
I usually use the 'c:\windows\temp' directory. That is on almost any computer running windows.

Ross
0
 

Author Comment

by:pc_melsa
ID: 2763217
Thanks !
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question