views:

28

answers:

1

I'm asking this as a follow-up to my previous question: http://stackoverflow.com/questions/3221364/what-is-a-good-way-of-accessing-dbase-files-using-bde-and-delphi

It was suggested that I called upon a Delphi COM server instead of passing data though standard input/output, and I totally agree that such a solution is very limited.

Basically I need a way to call BDE from C#, without using ADO/OLEDB. Origianlly my requirement was having the ability to execute queries directly and having some sort of RecordSet object returned, but I'm also okay with a strongly typed interface with method such as:

uint CreateCustomer(string fname, string lname, string addr, string email) uint CreateContract(...) bool DeleteContract(...)

I would prefer not having to register a COM server with regsvr32, but rather use Interop and DllImport to call DLL methods directly. Using the latter approach, are there any special considerations with regards to resource cleanup and "BDE Sessions" and what not.

Also, what would be the proper way to handle exceptions and ensure any BDE (or other) resources are freed if exceptions occur?

I have a lot of questions, and I'm not really sure how to present them in a clear way :)

EDIT: I'm fully aware that BDE is 'dead', but I have no control whatsoever over the third-party software that's still using BDE.

A: 

I missed your original BDE question, so I put up a fresh answer there as well.

Basically: skip the BDE, and try Advantage Database Server:

--jeroen

Jeroen Pluimers
This doesn't help me at all I'm afraid, because I need to use the BDE to properly interoperate with an older BDE-based application of which I have no control.
thomask
OK. Can you edit your question to give a more detailed description of how the older BDE-based application looks like (from a technical point of view) and how you want to call it (from a functional perspective)?
Jeroen Pluimers
If you take a look at my question, you can see that I'm concerned about resource usage and exceptions in particular. I have encountered situations where the other app locks up during BDE-calls/dataaccess if my application isn't terminated properly. As if the BDE hangs on a mutex that isn't released or some sort of file lock. The situation resolves by stopping/restarting both processes.
thomask
That's why I suggested using the Advantage Database Server in your other question; there was no reaction on that, so I wondered what it is that you are really after: i.e. why Advantage Database Server is no option for you.
Jeroen Pluimers