Solved

Lock Paradox Table

Posted on 2000-04-24
12
463 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
Independent Software Vendors: 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 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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