xsharp.eu • WPF app and DBF file
Page 1 of 2

WPF app and DBF file

Posted: Sat Jan 16, 2021 10:53 am
by Juraj
Hi All,

I want to open an existing dbf file in the wpf app, create a new dbf file with the same structure and transfer the selected records into new dbf. Which XSharp Dll need to be added to the WPF app (Core dialect)?

Juraj

WPF app and DBF file

Posted: Sat Jan 16, 2021 1:54 pm
by wriedmann
Hi Juraj,
it depends if you are using the DBServer or the functional access.
For the functional access you need the X# Runtime, the macrocompiler and the RDD:
XSharp.Core
XSharp.VO
XSharp.Macrocompiler
XSharp.RDD
XSharp.RT
If you like to use the DBServer class, you need also
XSharp.VORDDClasses
XSharp.VOSystemClasses.
Wolfgang
P.S. you can also use the VORDDClasses and the VOSystemClasses instead, but then you are limited to 32 Bit

WPF app and DBF file

Posted: Sun Jan 17, 2021 8:06 am
by Juraj
Hi Wolfgang,
Thank you for your response. When I use this code:
                dbUseArea(TRUE,"DBFCDX","OLDDBFFILE","OLD",FALSE)
                dbCopyStruct("NEWDBFFLE")
                dbCloseArea()
                dbCloseAll()
OLDDBFFILE is created in VO 2.6 app.
OLDDBFFILE I can open i MS Excel, NEWDBFFILE can not open in MS Excel or another DBF viewer. Error message : the file has a different formatJuraj

WPF app and DBF file

Posted: Sun Jan 17, 2021 8:19 am
by Chris
Hi Juraj,

Can you please send this dbf file?

WPF app and DBF file

Posted: Sun Jan 17, 2021 8:39 am
by Chris
Hi Wolfgang,
 P.S. you can also use the VORDDClasses and the VOSystemClasses instead, but then you are limited to 32 Bit
Those two libraries are AnyCPU in X#! :)

WPF app and DBF file

Posted: Sun Jan 17, 2021 8:49 am
by Juraj
HI Chris,

file in attachments

Juraj

WPF app and DBF file

Posted: Sun Jan 17, 2021 8:56 am
by Juraj
Hi Chris,
in attachments
Juraj

WPF app and DBF file

Posted: Sun Jan 17, 2021 10:38 am
by Chris
Hi Juraj,

Thanks, I gave it a try and do not see an obvious problem, I can open the created new file with a dbeditor full without issues. Can you please send also a compilable sample that reproduces the problem?

WPF app and DBF file

Posted: Sun Jan 17, 2021 11:41 am
by Juraj
Hi Chris,
the user of the application opens this file in the MS excel program and continues to work with it. So I need that the file can also be opened in MS excel.
I will prepare the sample and send it.

Juraj

WPF app and DBF file

Posted: Sun Jan 17, 2021 1:01 pm
by FFF
Jurai,
opened your file with Planmaker (an Excel-clone), with plain X# and with cmVoDBX without any problem.
LibreOffice 7.0 complains the file to be damaged.
Does it make any difference, if you add at least one record to the file?