xsharp.eu • Open a DBF without extension using the DbUseArea() function
Page 1 of 1

Open a DBF without extension using the DbUseArea() function

Posted: Sat Dec 28, 2024 6:48 pm
by Irwin
Hi Robert,

I have a legacy (VFP) program that uses a DBF as a configuration file but it hasn't extension eg: "config" instead of "config.dbf". In VFP you can open this file like this:

Code: Select all

USE c:\my\path\to\config. && note the dot (.) at the end.
When I open the file using the DbUseArea(...) then I get the FileNotFound exception: File not found "config.dbf" the function adds the .dbf if the file doesn't provide it. Is there a way to open a DBF file without providing its extension or even better, providing any extension eg: scx, vcx, etc?

thanks.

Re: Open a DBF without extension using the DbUseArea() function

Posted: Mon Jan 13, 2025 11:22 am
by Chris
Hi Irwin,

Sorry, I had missed this one before, but I now checked it and it is a bug, also VO can open dbf files without an extension, but X# currently doesn't. Will open a ticket for this now.

Re: Open a DBF without extension using the DbUseArea() function

Posted: Mon Jan 13, 2025 3:12 pm
by Irwin
Chris wrote: Mon Jan 13, 2025 11:22 am Hi Irwin,

Sorry, I had missed this one before, but I now checked it and it is a bug, also VO can open dbf files without an extension, but X# currently doesn't. Will open a ticket for this now.
thanks chris, I need this badly because my legacy app has a no extension table and I need to open it, for now I'm just copying the file to another one with the proper DBF extension and then open it to read the data (yes, I know this smells but I had no choice) and delete right then.

Re: Open a DBF without extension using the DbUseArea() function

Posted: Tue Jan 14, 2025 1:47 am
by Chris
Hi Irwin,

Understood, and Robert has already fixed that problem today!

https://github.com/X-Sharp/XSharpPublic/issues/1671

Re: Open a DBF without extension using the DbUseArea() function

Posted: Tue Jan 14, 2025 8:32 am
by robert
Chris,
Can you rebuild XSharp.Core and send it to Irwin for testing?

Robert

Re: Open a DBF without extension using the DbUseArea() function

Posted: Tue Jan 14, 2025 10:38 am
by Chris
Robert, Irwin,

A new dll for testing the fix can be found here: https://github.com/X-Sharp/XSharpPublic ... 2589567931

Irwin, you need to replace the old dll in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\XSharp.Core\v4.0_2.6.0.0__ed555a0467764586

Re: Open a DBF without extension using the DbUseArea() function

Posted: Tue Jan 14, 2025 5:38 pm
by Irwin
Chris wrote: Tue Jan 14, 2025 10:38 am Robert, Irwin,

A new dll for testing the fix can be found here: https://github.com/X-Sharp/XSharpPublic ... 2589567931

Irwin, you need to replace the old dll in C:\Windows\Microsoft.NET\assembly\GAC_MSIL\XSharp.Core\v4.0_2.6.0.0__ed555a0467764586
it works guys, thanks a lot!

Re: Open a DBF without extension using the DbUseArea() function

Posted: Wed Jan 15, 2025 1:20 am
by Chris
Hi Irwin,

Great, thanks for the feedback! Btw, it's too late to include this change in the upcoming build, as the installer is already tested and ready, so after installing it (should be out very soon), please apply again the new dll.

Re: Open a DBF without extension using the DbUseArea() function

Posted: Wed Jan 15, 2025 7:59 am
by Irwin
Chris wrote: Wed Jan 15, 2025 1:20 am Hi Irwin,

Great, thanks for the feedback! Btw, it's too late to include this change in the upcoming build, as the installer is already tested and ready, so after installing it (should be out very soon), please apply again the new dll.
Ok Chris, I'll do the replacement once updated the new version. Thanks a lot!