share a paradox file between a delphi app and another app 
Author Message
 share a paradox file between a delphi app and another app

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



Thu, 17 Nov 2005 17:35:10 GMT
 share a paradox file between a delphi app and another app

Quote:

> 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



Thu, 17 Nov 2005 19:17:05 GMT
 share a paradox file between a delphi app and another app
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



Thu, 17 Nov 2005 21:39:46 GMT
 share a paradox file between a delphi app and another app


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.


Sat, 19 Nov 2005 03:30:56 GMT
 share a paradox file between a delphi app and another app

Quote:

> 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



Sat, 19 Nov 2005 15:56:27 GMT
 share a paradox file between a delphi app and another app
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



Sat, 19 Nov 2005 17:53:04 GMT
 share a paradox file between a delphi app and another app
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



Sat, 19 Nov 2005 17:57:01 GMT
 share a paradox file between a delphi app and another app


Quote:

> > 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.


Sun, 20 Nov 2005 00:44:37 GMT
 
 [ 8 post ] 

 Relevant Pages 

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

2. Paradox app to Delphi

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

4. MultiUser Delphi App Using Paradox - Help !

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

6. Delphi/Paradox app on a NT netware

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

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

9. Help with Paradox DBE in a Delphi App

10. Running Delphi app and paradox on the net

11. Delphi/Paradox Win Apps

12. Need good program to create help files for Delphi apps


 
Powered by phpBB® Forum Software