Solved

Lock Paradox Table

Posted on 2000-04-24
12
454 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now