Board index » delphi » Client/Server problem with Paradox-Tables in Delphi

Client/Server problem with Paradox-Tables in Delphi

Hi people!

I have a very urgent problem with a client/server app in Delphi!
My problem:
  I am using a Delphi programm that accesses Paradox-Tables via Tables
  (I cant use Queries for most tasks - they are too slow!). Running the app
  on a single computer with just one instance is no problem at all. But if
I
  start a second instance (either on the same computer or on a network)
  I get an exception, that a table is busy (locked by another application).

My question(s):
  Is it possible to lock just a single record instead of the complete table
?
  Or is there another way to solve my problem. If the app doesnt work on
  a network, 8 months of developing would be totally wasted :-(
  Does anybody know a workaround or can give me hint (I cant use
  DBMs like Oracle or Interbase because my program would become
  too expensive) ????

If you know an answer please be so kind to reply to me via e-mail (if
possible).

Lots of thanks in advance,
Markus Plesser  (e9300...@stud1.tuwien.ac.at)

 

Re:Client/Server problem with Paradox-Tables in Delphi


Its me again!

Some more information:
I am using a TDatabase-Component to set the alias dynamically.
The app is designed for Win3.x/Win95/Win NT 4.0 and the source is
designed to compile under D1 & D2 correctly. I dont know how to set the
Paradox-Netfile-Dir. from my app. (Does anybody know how to do that).
Is it possible to upgrade to e.g. Interbase only by changing the Alias (via
TDatabase) ???
Is there a possibility to open locked tables in some sort of "read-only"
mode ???

Thanks,
Markus Plesser (e9300...@stud1.tuwien.ac.at)

Re:Client/Server problem with Paradox-Tables in Delphi


Run BDECFG and make sure all uses NET FILE DIR points to the same path. You
should only have one copy of PXDUSERS.NET (or similar) and ALL users must
point to the same one.

My app runs fine on a network.
--

Tox
---------------------------------------------------------------------
Two men walk into a bar one after the other, you would have thought
that the second guy would have been smarter.
---------------------------------------------------------------------
This item was brought to you by the letters E and B and the number 7

Markus Plesser <e9300...@stud1.tuwien.ac.at> wrote in article
<01bbb2db$b20255a0$LocalH...@e9300600.stud1.tuwien.ac.at>...

Quote
> Hi people!

> I have a very urgent problem with a client/server app in Delphi!
> My problem:
>   I am using a Delphi programm that accesses Paradox-Tables via Tables
>   (I cant use Queries for most tasks - they are too slow!). Running the
app
>   on a single computer with just one instance is no problem at all. But
if
> I
>   start a second instance (either on the same computer or on a network)
>   I get an exception, that a table is busy (locked by another
application).

> My question(s):
>   Is it possible to lock just a single record instead of the complete
table
> ?
>   Or is there another way to solve my problem. If the app doesnt work on
>   a network, 8 months of developing would be totally wasted :-(
>   Does anybody know a workaround or can give me hint (I cant use
>   DBMs like Oracle or Interbase because my program would become
>   too expensive) ????

> If you know an answer please be so kind to reply to me via e-mail (if
> possible).

> Lots of thanks in advance,
> Markus Plesser  (e9300...@stud1.tuwien.ac.at)

Re:Client/Server problem with Paradox-Tables in Delphi


I don't really believe you could have overlooked this but just in case
...... you don't have the table 'Exclusive' property set to Yes do you
??

Quote
>Markus Plesser <e9300...@stud1.tuwien.ac.at> wrote in article
><01bbb2db$b20255a0$LocalH...@e9300600.stud1.tuwien.ac.at>...
>> Hi people!

>> I have a very urgent problem with a client/server app in Delphi!
>> My problem:
>>   I am using a Delphi programm that accesses Paradox-Tables via Tables
>>   (I cant use Queries for most tasks - they are too slow!). Running the
>app
>>   on a single computer with just one instance is no problem at all. But
>if
>> I
>>   start a second instance (either on the same computer or on a network)
>>   I get an exception, that a table is busy (locked by another
>application).

>> My question(s):
>>   Is it possible to lock just a single record instead of the complete
>table
>> ?
>>   Or is there another way to solve my problem. If the app doesnt work on
>>   a network, 8 months of developing would be totally wasted :-(
>>   Does anybody know a workaround or can give me hint (I cant use
>>   DBMs like Oracle or Interbase because my program would become
>>   too expensive) ????

>> If you know an answer please be so kind to reply to me via e-mail (if
>> possible).

>> Lots of thanks in advance,
>> Markus Plesser  (e9300...@stud1.tuwien.ac.at)

Re:Client/Server problem with Paradox-Tables in Delphi


One other thing - to lock a record call the .Edit method and do an
exception test. You must have come across this in your 8 months ? If you
need more details please Email.

P.W.

Quote
>> I have a very urgent problem with a client/server app in Delphi!
>> My problem:
>>   I am using a Delphi programm that accesses Paradox-Tables via Tables
>>   (I cant use Queries for most tasks - they are too slow!). Running the
>app
>>   on a single computer with just one instance is no problem at all. But
>if
>> I
>>   start a second instance (either on the same computer or on a network)
>>   I get an exception, that a table is busy (locked by another
>application).

>> My question(s):
>>   Is it possible to lock just a single record instead of the complete
>table
>> ?
>>   Or is there another way to solve my problem. If the app doesnt work on
>>   a network, 8 months of developing would be totally wasted :-(
>>   Does anybody know a workaround or can give me hint (I cant use
>>   DBMs like Oracle or Interbase because my program would become
>>   too expensive) ????

>> If you know an answer please be so kind to reply to me via e-mail (if
>> possible).

>> Lots of thanks in advance,
>> Markus Plesser  (e9300...@stud1.tuwien.ac.at)

Re:Client/Server problem with Paradox-Tables in Delphi


Quote
Markus Plesser wrote:
> I am using a TDatabase-Component to set the alias dynamically.
> The app is designed for Win3.x/Win95/Win NT 4.0 and the source is
> designed to compile under D1 & D2 correctly. I dont know how to set the
> Paradox-Netfile-Dir. from my app. (Does anybody know how to do that).

Hello Markus,

a few days ago I posted a way to setup paradox files in a network,
perhaps it's usefull for you, too:

1. Store the tables in a directory on the server not on a (or all)
workstations.
2. Grant the rights the users should have (e.g. RF for users only
allowed to read data, RWMF for users allowed to modify data, etc.)
3. Very important: Make sure that all workstations have the same
mappings for the drives with the tables.
4a. Create another directory on the same network drive and grant RWCMEF
to all potential users of the tables for it.
4b. Start the BDE configuration programm and change the property
'netdir' of the Paradox driver to this directory.
4c. Alternativly you can add the following lines to the project file
(.dpr) before
any of the forms of your project are created:

            Session.NetFileDir := 'Networkdrive:\NetworkDirectory';
            Session.PrivateDir := 'LocalDrive:\LocalDirectory;

this commands will override the settings made in the BDE. If this files
stored in a
INI-file it's quite easy to
5. (optional) Create an Alias with the name of the directory you used
for your tables as the value of the 'databasename' property of this
alias.
6. Use this alias in your applications and in the IDE.

Quote
> Is it possible to upgrade to e.g. Interbase only by changing the Alias (via
> TDatabase) ???

Yes it is, but you don't want to do this. Database servers needs a
totally different kind of dataaccess to get a good performance, but as a
{*word*128}step it is possible.

Quote
> Is there a possibility to open locked tables in some sort of "read-only"
> mode ???

No, if a table is opened 'exclusive' no concurrent access is allowed.
Set this property to 'false' for all TTable objects you use in your
project (except for those you use for reindexing or packing).
Generally set all TTables to 'RoadOnly' if you don't have to write to
them, this will give you a (little) faster access.

If you have questions please feel free to send me a mail or post it to
the newsgroup.

HTH

Thomas

--
Thomas Scheffczyk
----------------------------------------------------------------
email: scheffc...@verwaltung.uni-mainz.de
home : http://www.verwaltung.uni-mainz.de/Dez1/edv/folks/scheff/

Re:Client/Server problem with Paradox-Tables in Delphi


You must set the Net dir in BDE configure manager. And that dir must be
the same physical dir (e.g., on the "server") for all computers
accessing the tables. It must also be the same "mapped" dir (e.g.,
k:\pdoxdata, where k: is the mapped drive letter used by all the
clients). The Borland tech support Web site has more info on this.

Set up correctly. A handful of users will not notice any performance
degradation compared to a single user (in my experience).

Jim Berry
USDA-APHIS Phoenix Plant Protection Center
p...@xroads.com

Other Threads