share a paradox file between a delphi app and another app

share a paradox file between a delphi app and another app

Post by Eric Houran » Mon, 02 Jun 2003 18:35:10



Hello,

I have install DataDirect odbc driver to access Paradox files from our own
applications and from Excel.

I'm currently using an accounting package written in Delphi 5 which is using
Paradox files and the BDE. The netdirectory for this app has been set to a
specific directory ( O:\MYACCOUNTING\NET\ to make things clear). When I run
this app, the pdoxusrs.net file is created in this directory.

When I run my own app or a query in Excel, this file is also created in the
same directory. So we are sure that we are using the same file. I can use
both apps with the same pdoxusrs.net file but not both at the same time.

My accounting is open. I run a query in Excel and get the following message
:Driver's SQLAllocHandleon SQL_HANDLE_ENV failes.

This is exactly the same error message when I try to acces the accounting
files from my app.

Any suggestion (maybe something else than using this odbc driver) ?

TIA

Eric

 
 
 

share a paradox file between a delphi app and another app

Post by Markku Nevalaine » Mon, 02 Jun 2003 20:17:05



> My accounting is open. I run a query in Excel and get the following message
> :Driver's SQLAllocHandleon SQL_HANDLE_ENV failes.

This could ve BDE's Private Directory problem. In multi user environment
every user user should have their own Private directory, on their
local hard disk. BDE stores there temporary files that SQL Queries
create.

If two users store their temporary files to the same directory,
this causes errors and conflicts.

With BDE you can set the user's Private Directory in Delphi code.
But I'm not sure how the Private directory problem is handled
when you access Paradox tables via ODBC.

Maybe you could start your Excel ODBC query, and check to which
directory those temporary files appear.
And then in your Delphi app set the second user's Private
directory to somewhere else.

This is all my quessing only. I have never worked with Paradox
tables via ODBC.

Markku Nevalainen

 
 
 

share a paradox file between a delphi app and another app

Post by Eric Houran » Mon, 02 Jun 2003 22:39:46


Hello Markku,
Thanks for your answer.

Quote:>> Maybe you could start your Excel ODBC query, and check to which directory

those temporary files appear. <<
For my simple query, Excel doesn't create any file in the private directory.
Anyway, just to be sure both private directories are different, I have set
the private directory of the accounting application to a dummy one (there is
a parameter for this purpose). And the problem is still there.
I do not have the control (I mean the source) over the accounting but I'm
nearly sure it works properly.

With one simple program, I have traced the problem and it seems that as soon
as the connection is established, the odbc driver places a kind of lock on
the pdoxusrs.net that prevents anyone else to use it.
When I leave my program, the odbc driver "frees" the pdoxusrs.net and let
others use it.

If the accounting is running, my simple program can't place this "lock" on
the pdoxusrs.net and the driver returns an error.

It's my explanation but I'm not sure about it. I also made the same test
with another odbc driver (from intersolv) with exactly the same result.

Eric

 
 
 

share a paradox file between a delphi app and another app

Post by Bruce Robert » Wed, 04 Jun 2003 04:30:56



Quote:> Hello,

> I have install DataDirect odbc driver to access Paradox files from our own
> applications and from Excel.

> I'm currently using an accounting package written in Delphi 5 which is
using
> Paradox files and the BDE. The netdirectory for this app has been set to a
> specific directory ( O:\MYACCOUNTING\NET\ to make things clear). When I
run
> this app, the pdoxusrs.net file is created in this directory.

I would suspect a problem with either the Net file directory path or the
path to the database, my money would be on the later. For Paradox the path
has to be textually the same for each application attempting to open the
file. Thus if Delphi is using O:\MyAccounting\Data to get to the database,
Excel has to also use O:\MyAccounting\Data. When Win2k and XP environments
are involved I've observed that its best to use a UNC path name instead of a
mapped drive. For some reason mapped drive letters don't seem to work
consistently with Paradox in these environments.
 
 
 

share a paradox file between a delphi app and another app

Post by Markku Nevalaine » Wed, 04 Jun 2003 16:56:27



> For Paradox the path
> has to be textually the same for each application attempting to open the
> file.

AFAIK this Path rule relates only to BDE NetFileDir setting. The database
app itself can access the tables with any path setting there is, but
NetFileDir setting for BDE is more picky.

I do not know how you set the NetFileDir setting for Paradox ODBC, or
even if it is necessary to set there.

Quote:> For some reason mapped drive letters don't seem to work
> consistently with Paradox in these environments.

I still have some 16-bit BDE apps running out there. And customers
have installed them also on W2k and XP machines. The 16-bit BDE does
not understand anything about UNC paths, so the only alternative
is to use mapped drives.
This mapping seems to work all right on W2k and XP too, already for
several years.

Markku Nevalainen

 
 
 

share a paradox file between a delphi app and another app

Post by Eric Houran » Wed, 04 Jun 2003 18:53:04


Bruce,
Quote:>> I would suspect a problem with either the Net file directory path or the

path to the database, <<
I understand your answer. But the error occurs when attenting to create the
connection. I don't try to access a file yet.

I got another suggestion from someone else. He suggested to move move the
idapi32.dll file to the windows\systems folder but this doesn't work
neither.

Eric

 
 
 

share a paradox file between a delphi app and another app

Post by Eric Houran » Wed, 04 Jun 2003 18:57:01


Markku,

Quote:>> I do not know how you set the NetFileDir setting for Paradox ODBC, or<<

This is the code I use to creat my connection (don't bother with the
Visual-Object syntax, it's more or less similar the the VB one).

LOCAL oConn AS AdoConnection
..
  oConn := AdoConnection{}
  oConn:ConnectionTimeout := 5
..
  oConn:Mode    :=adModeShareDenyNone
  oConn:CursorLocation :=adUseServer
  oConn:Open("DSN=BobDataDirect; ND=O:\MYACCOUNTING\NET\ ;", NIL, NIL, NIL)

Eric

 
 
 

share a paradox file between a delphi app and another app

Post by Bruce Robert » Thu, 05 Jun 2003 01:44:37




> > For Paradox the path
> > has to be textually the same for each application attempting to open the
> > file.

> AFAIK this Path rule relates only to BDE NetFileDir setting. The database
> app itself can access the tables with any path setting there is, but
> NetFileDir setting for BDE is more picky.

If memory serves there is a Borland tech paper on the subject. My memory was
that the db path was involved in holding and resolving file locks. sigh . .
. I guess I'm going to have to track down the tech note.

Quote:

> I do not know how you set the NetFileDir setting for Paradox ODBC, or
> even if it is necessary to set there.

> > For some reason mapped drive letters don't seem to work
> > consistently with Paradox in these environments.

> I still have some 16-bit BDE apps running out there. And customers
> have installed them also on W2k and XP machines. The 16-bit BDE does
> not understand anything about UNC paths, so the only alternative
> is to use mapped drives.
> This mapping seems to work all right on W2k and XP too, already for
> several years.

This may be so with 16-bit apps, (which happily I no longer have to worry
about), but we did have some troubles using mapped drive letters in W2k and
XP environments in our 32-bit apps (which were resolved when UNC paths were
used). Of course these troubles may well have be unrelated, given the fact
that we are dealing with phone support solutions.
 
 
 

1. Using shared Paradox tables with stand-alone apps (Delphi 3.0)

Hello,

I'm currently working on a database program which uses nine Paradox tables.
Al tables are loaded in the TTable components (without using aliases).
The program will be installed on serveral client computers, using the
(shared) Pdox tables which are on a NT 4.0 server, execept for one local
Pdox table installed in the default dir of the program. This local table is
being used for temporary puposes and for batch uploads.
The program is written in Delphi 3.0 Pro.

My questions:
1. How can I avoid that two or more users can edit the same record in the
same (shared) table, with other words: how can I place a record lock in a
Pdox table and unlock the record after the edit has been posted?

2. When a user wants to post a batch-upload, I want a table lock on the
table where the uploads will be posted to and an unlock after posting the
updates. So: how to lock the entire table?

3. After a single or a batch upload, all users have to see the updates
immediately. Which actions should be performed to catch all updates?

I would be very pleased if you could help me out with these problems. I've
tried the TSession component, but it caused a "Table is busy" error while
opening the local table in the default directory of the program.

Greetings and thanks in advance,

Francina

http://www.xs4all.nl/~francina

2. EXPORT / IMPORT VIEWS defined by FUNCTIONS

3. Paradox app to Delphi

4. headhunters on the Net

5. Migrating a Delphi 3 - Paradox c/s app to MSSQL Server 6.5

6. Problem resetting proxy account

7. MultiUser Delphi App Using Paradox - Help !

8. Query for Average Daily Events

9. Migrating a Delphi 3 - Paradox c/s app to MSSQL Server 6.5

10. Delphi/Paradox app on a NT netware

11. Migrating a Delphi 3 - Paradox c/s app to MSSQL Server 6.5

12. Help with Paradox DBE in a Delphi App