Board index » off-topic » BDE-DBF Cannot Load Driver

BDE-DBF Cannot Load Driver


2007-04-19 04:22:00 PM
off-topic19
Hi all,
I've googling around and I find references to my problem but I can't
find the solution. I hope you can help me.
I have two applications using BDE and DBF driver working smoothly for
years. One application executes the other to do some tasks. The share a
DBF file to exchange information.
The problem:
In Windows XP - Service Pack 2 when there is an application using BDE
and DBF driver, ant tries to execute the other app I receive the error:
BDE error: $3E05 : "Cannot load driver"
It seems related with Service Pack 2. The error is received when I check
for the existence of the driver:
hDBISes sesion;
DBIResult result, resultFunc;
hDBICfg hCfg;
result = DbiInit((struct DBIEnv *)NULL);
result = DbiLoadDriver("DBASE");
return result; // <= Error $3E05 here
I end up asking my users to reinstall the application.
Is there a known solution to this?
Thanks
Rob
 
 

Re:BDE-DBF Cannot Load Driver

Hi,
I've posted this already on May 19th 2006, but didn't find it in the group
anymore. So I did copy/paste ... maybe it will help.
I recognized similar problems. Some applications throw this error (3E05)
when the BDE is already in use by another application. It turned out, that
loading the driver fails when an ADO connection is created prior to
initializing the BDE.
Apparently the problem arised with ADO 2.8, which seems to initialize the
BDE in a way that's not compatible with the usage of the BDE API.
To avoid this problems it's necessary to initialize the BDE and load the
required drivers prior to creating an ADO connection. This can be done
either implicitly by opening a database with the BDE or explicitly by
calling the API functions DbiInit() and DbiLoadDriver().
In my case (Delphi, dBASE) this means:
use DBTables, BDE;
:
Check(DbiInit(nil));
Check(DbiLoadDriver(szDBASE));
Instead of calling DbiInit() you can alternatively use "Session.Open" which
might pass additional stuff in the DBIEnv structure.
Keep in mind to ensure that these calls are made before your application
creates its first ADO connection! (Delphi: when using TADOConnection
components on a form, this means that TForm.OnCreate is not suitable!).
Furthermore it's not the best practice to load some drivers before they are
really needed. For instance an application using the BDE only for some
imports should not fail to start due to missing drivers, etc.
Marx
"rob" < XXXX@XXXXX.COM >schrieb im Newsbeitrag
Quote
Hi all,

I've googling around and I find references to my problem but I can't
find the solution. I hope you can help me.

I have two applications using BDE and DBF driver working smoothly for
years. One application executes the other to do some tasks. The share a
DBF file to exchange information.

The problem:

In Windows XP - Service Pack 2 when there is an application using BDE
and DBF driver, ant tries to execute the other app I receive the error:

BDE error: $3E05 : "Cannot load driver"

It seems related with Service Pack 2. The error is received when I check
for the existence of the driver:

hDBISes sesion;
DBIResult result, resultFunc;
hDBICfg hCfg;

result = DbiInit((struct DBIEnv *)NULL);
result = DbiLoadDriver("DBASE");

return result; // <= Error $3E05 here

I end up asking my users to reinstall the application.


Is there a known solution to this?


Thanks

Rob
 

Re:BDE-DBF Cannot Load Driver

Hi Marx,
Thanks for your reply.
Your workaround seems not working for me. It is exactly what I am doing
right now. I Check for the driver in WinMain(), before the forms are
created and is then when I get the error. The driver seems not to be
available by then, at program start.
If the other application is in execution, I get the error.
I'm not aware of making any ADO connection either.
I've being playing with Session->PrivateDir and Session->NetFileDir with
no success.
Rob
Quote
Hi,

I've posted this already on May 19th 2006, but didn't find it in the
group anymore. So I did copy/paste ... maybe it will help.

I recognized similar problems. Some applications throw this error (3E05)
when the BDE is already in use by another application. It turned out, that
loading the driver fails when an ADO connection is created prior to
initializing the BDE.

Apparently the problem arised with ADO 2.8, which seems to initialize the
BDE in a way that's not compatible with the usage of the BDE API.

To avoid this problems it's necessary to initialize the BDE and load the
required drivers prior to creating an ADO connection. This can be done
either implicitly by opening a database with the BDE or explicitly by
calling the API functions DbiInit() and DbiLoadDriver().

In my case (Delphi, dBASE) this means:

use DBTables, BDE;
:
Check(DbiInit(nil));
Check(DbiLoadDriver(szDBASE));

Instead of calling DbiInit() you can alternatively use "Session.Open" which
might pass additional stuff in the DBIEnv structure.

Keep in mind to ensure that these calls are made before your application
creates its first ADO connection! (Delphi: when using TADOConnection
components on a form, this means that TForm.OnCreate is not suitable!).

Furthermore it's not the best practice to load some drivers before they are
really needed. For instance an application using the BDE only for some
imports should not fail to start due to missing drivers, etc.

Marx


>Hi all,
>
>I've googling around and I find references to my problem but I can't
>find the solution. I hope you can help me.
>
>I have two applications using BDE and DBF driver working smoothly for
>years. One application executes the other to do some tasks. The share a
>DBF file to exchange information.
>
>The problem:
>
>In Windows XP - Service Pack 2 when there is an application using BDE
>and DBF driver, ant tries to execute the other app I receive the error:
>
>BDE error: $3E05 : "Cannot load driver"
>
>It seems related with Service Pack 2. The error is received when I check
>for the existence of the driver:
>
>hDBISes sesion;
>DBIResult result, resultFunc;
>hDBICfg hCfg;
>
>result = DbiInit((struct DBIEnv *)NULL);
>result = DbiLoadDriver("DBASE");
>
>return result; // <= Error $3E05 here
>
>I end up asking my users to reinstall the application.
>
>
>Is there a known solution to this?
>
>
>Thanks
>
>Rob

 

{smallsort}

Re:BDE-DBF Cannot Load Driver

I finally got it to work!
My applications use BDE: one the native driver for DBASE and and the
other ODBC driver for Access "Microsoft Access Driver (*.mdb)".
It seems is what it is not enought to open the connection or the session
or load the dBase native driver before any other connection is made. I
have to actually run a query on the dBase connection.
After doing so I can work with Access ODBC without locking the dBase driver.
If the application does the other way around, it opens the connection
but locks the driver for other applications trying to use the BDE native
dBase driver running on the same machine.
The problem is that this solution is only partial. Having done this, my
application is "Well behaving", but any other "bad behaving" application
can negatively affect and prevent my application to use dBase files.
Anyway, my both cooperating applications can be patched to do the right
way and I can change the check asking the user to reinstall the
application (and BDE) when DbiInit() fails and ask the user to close
other BDE applications when DbiLoadDriver("DBASE") fails.
Thanks Marx for your help
Rob
Quote
Hi Marx,

Thanks for your reply.

Your workaround seems not working for me. It is exactly what I am doing
right now. I Check for the driver in WinMain(), before the forms are
created and is then when I get the error. The driver seems not to be
available by then, at program start.

If the other application is in execution, I get the error.

I'm not aware of making any ADO connection either.

I've being playing with Session->PrivateDir and Session->NetFileDir with
no success.

Rob

>Hi,
>
>I've posted this already on May 19th 2006, but didn't find it in the
>group anymore. So I did copy/paste ... maybe it will help.
>
>I recognized similar problems. Some applications throw this error (3E05)
>when the BDE is already in use by another application. It turned out, that
>loading the driver fails when an ADO connection is created prior to
>initializing the BDE.
>
>Apparently the problem arised with ADO 2.8, which seems to initialize the
>BDE in a way that's not compatible with the usage of the BDE API.
>
>To avoid this problems it's necessary to initialize the BDE and load the
>required drivers prior to creating an ADO connection. This can be done
>either implicitly by opening a database with the BDE or explicitly by
>calling the API functions DbiInit() and DbiLoadDriver().
>
>In my case (Delphi, dBASE) this means:
>
>use DBTables, BDE;
>:
>Check(DbiInit(nil));
>Check(DbiLoadDriver(szDBASE));
>
>Instead of calling DbiInit() you can alternatively use "Session.Open" which
>might pass additional stuff in the DBIEnv structure.
>
>Keep in mind to ensure that these calls are made before your application
>creates its first ADO connection! (Delphi: when using TADOConnection
>components on a form, this means that TForm.OnCreate is not suitable!).
>
>Furthermore it's not the best practice to load some drivers before they are
>really needed. For instance an application using the BDE only for some
>imports should not fail to start due to missing drivers, etc.
>
>Marx
>
>
>>Hi all,
>>
>>I've googling around and I find references to my problem but I can't
>>find the solution. I hope you can help me.
>>
>>I have two applications using BDE and DBF driver working smoothly for
>>years. One application executes the other to do some tasks. The share a
>>DBF file to exchange information.
>>
>>The problem:
>>
>>In Windows XP - Service Pack 2 when there is an application using BDE
>>and DBF driver, ant tries to execute the other app I receive the error:
>>
>>BDE error: $3E05 : "Cannot load driver"
>>
>>It seems related with Service Pack 2. The error is received when I check
>>for the existence of the driver:
>>
>>hDBISes sesion;
>>DBIResult result, resultFunc;
>>hDBICfg hCfg;
>>
>>result = DbiInit((struct DBIEnv *)NULL);
>>result = DbiLoadDriver("DBASE");
>>
>>return result; // <= Error $3E05 here
>>
>>I end up asking my users to reinstall the application.
>>
>>
>>Is there a known solution to this?
>>
>>
>>Thanks
>>
>>Rob