Open a DBF without extension using the DbUseArea() function

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Irwin
Posts: 98
Joined: Wed Mar 23, 2022 10:24 am
Location: España

Open a DBF without extension using the DbUseArea() function

Post 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.
User avatar
Chris
Posts: 5044
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Irwin
Posts: 98
Joined: Wed Mar 23, 2022 10:24 am
Location: España

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

Post 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.
User avatar
Chris
Posts: 5044
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post by Chris »

Hi Irwin,

Understood, and Robert has already fixed that problem today!

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

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4597
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

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

Post by robert »

Chris,
Can you rebuild XSharp.Core and send it to Irwin for testing?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 5044
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Irwin
Posts: 98
Joined: Wed Mar 23, 2022 10:24 am
Location: España

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

Post 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!
User avatar
Chris
Posts: 5044
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Irwin
Posts: 98
Joined: Wed Mar 23, 2022 10:24 am
Location: España

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

Post 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!
Post Reply