views:

526

answers:

3

I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file. I'm using only a TQuery Object to do this (nothing else). can I access a Delphi DBIV database without it creating these lock files?

Thanks

Stew.

A: 

Why don't you want the lock files? Without really looking into it, I assume those lock files have a real purpose

It's been a while since I've used the BDE, but can't you use some keyword in your SELECT query to indicate that you do not want any locking?

For example in MS SQL you can use the following syntax:

SELECT * WITH(NOLOCK)
FROM SomeTable
Otherside
A: 

If your application is creating PARADOX.LCK and PDOXUSRS.LCK files, it is also creating or accessing a PDOXUSRS.NET file somewhere.

The BDE uses a single common PDOXUSRS.NET file, and a PARADOX.LCK and PDOXUSRS.LCK file in each shared directory, to coordinate shared access among the distributed instances of the engine.

You must find out if your application shares the tables with any other application. If the data is shared, you must allow the BDE to create and use these lock files.

If you are certain that you are the SOLE user of the data, you can eliminate the creation of the lock files. But -- unless the lock files are the only thing preventing you from doing something useful, it is rarely worth blocking their creation.

Registry entries tell the BDE where to find its configuration file. A configuration file editor ships with the BDE; look for BDEADMIN.EXE or BDECFG32.EXE. The configuration editor uses the same registry entry to determine which file to edit.

To avoid creating lock files when you are the sole user of the data:

  1. Open the config editor.

  2. Go to Configuration | Drivers | native | PARADOX, or Drivers | PARADOX, and note the NET DIR entry.

  3. Set the NET DIR value to blank.

  4. Go to Configuration | System | INIT, or System, and set LOCAL SHARE to False.

  5. Save your edits.

  6. Follow the path you noted in step 2 and delete the PDOXUSRS.NET found there.

  7. Delete any leftover PARADOX.LCK or PDOXUSRS.LCK files in your data directory.

Warning: fooling around with the lock files when you don't understand their purpose is a good way to brick your app.

-Al.

A: 

Thanks for your responses. I'll look into both of your suggestions.

To A I Breveleri:

yeah I know what your saying, I'm reluctant to switch them off, but the other App that uses the database is far more important than mine. Ideally I'd like the following to happen:

My app starts getting data, if the other app wants to use the database then my app stops.

At the moment the exact opposite is happening.

Stew.