Solved

Lock Paradox Table

Posted on 2000-04-24
12
450 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

12 Experts available now in Live!

Get 1:1 Help Now