Page 1 of 1
DBF Direct Connect
Posted: Mon 17 Dec 2018 14:51
by zat
For open DBF table, I'm use next code:
Code: Select all
UniConnection1->ProviderName = "DBF";
UniConnection1->SpecificOptions->Values["Direct"] = "true";
UniConnection1->Database = "C:\TEST";
UniTable1->TableName = "test";
UniConnection1->Connect();
Now, file opens, but only fields type: Character.
Numeric fields not showing.
When I'm using DirectMode = false, all fields showing, but it sometimes depends on the computer.
It works on one computer, on the other - no. Maybe it depends on the ODBC driver.
What am I doing wrong?
Upd.
May be very old file format?
Header dbf-file:
As I can see, this file has dBaseIII format(no memo), 0x03h
Format Visual FoxPro (0x30h) opens normal (may be change by hands: 0x03 to 0x30).
UniDac 7.4.11
RS 10.2.3
Win 10 x64
Re: DBF Direct Connect
Posted: Tue 18 Dec 2018 11:25
by azyk
Please use the contact form at our site:
https://www.devart.com/company/contactform.html and send us all the table files. For example, if a table named table_name, then send table_name.* files (table_name.dbf and table_name.* index and memo files).
Re: DBF Direct Connect
Posted: Tue 18 Dec 2018 12:02
by zat
OK. Sent
Re: DBF Direct Connect
Posted: Tue 18 Dec 2018 15:28
by azyk
Thank for the sent sample. We reproduced the issue and are investigating it now. We will inform you about the results.
Re: DBF Direct Connect
Posted: Fri 21 Dec 2018 11:27
by azyk
In the header of the file, it is specified that data is stored in the dBaseIII format. Therefore, when autodetecting the format, the some fields are fetched incorrectly. In fact, the data is stored in VisualFoxPro format. Therefore, to solve the issue, change the file header into VisualFoxPro. Or set the specific connection option 'DBFFormat' to 'dfVisualFoxPro'.
Re: DBF Direct Connect
Posted: Sun 23 Dec 2018 01:32
by zat
In VFP 9 SP2, when opened this file and display system info, VFP detect this file as dBaseIII.
VFP code:
Code: Select all
USE "test.dbf"
? SYS(2029) && show table type
Display result code:
3 - Previous versions of FoxPro, FoxBASE+, dBASE III PLUS, and dBASE IV with no memo field.
Table opens without any problem:
If we change code 0x03 to 0x30 (file header) and open this file in VFP, then table displayed only one field. It's error. VFP does not understand this format. It can be assumed that source file is correct. Perhaps the component does not correctly determine the file type.
Of course, if you explicitly specify the type of file in the component, the file opens and displays the required fields, but this is wrong. This is the same as open a JPG file as a GIF file. But if you open it in another program, it is a JPG.
It seems to me that the component incorrectly determines the file type.
Re: DBF Direct Connect
Posted: Fri 28 Dec 2018 11:37
by azyk
When the specific option 'DBFFormat' = 'dfAuto', UniDAC takes metadata from headers. In the sent file, the header says that data is stored in dBaseIII format. UniDAC fetches data according to dBaseIII specification:
https://www.dbase.com/Knowledgebase/INT ... le_fmt.htm . When the specific option 'DBFFormat' = 'dfVisualFoxPro', UniDAC will fetch data using VisualFoxPro format. Although there is another format in the header.
Re: DBF Direct Connect
Posted: Sat 29 Dec 2018 23:05
by zat
azyk wrote: ↑Fri 28 Dec 2018 11:37
When the specific option 'DBFFormat' = 'dfAuto', UniDAC takes metadata from headers. In the sent file, the header says that data is stored in dBaseIII format. UniDAC fetches data according to dBaseIII specification:
https://www.dbase.com/Knowledgebase/INT ... le_fmt.htm . When the specific option 'DBFFormat' = 'dfVisualFoxPro', UniDAC will fetch data using VisualFoxPro format. Although there is another format in the header.
Yes. But this format for files after 2010 year. And it's new format. Old format from 1990-2010 years have version
dBaseIII v.5. Sample of structure .dbf file may can see at this url:
http://www.dbf2002.com/dbf-file-format.html
Currently, these files are still actively used by many programs.
Re: DBF Direct Connect
Posted: Wed 09 Jan 2019 13:27
by azyk
We replied to your email.