On Mon, 23 Nov 2015, Jeff Stone wrote:
Hi,
> You are correct that we did execute RDDSETDEFAULT("DBFCDX") in our code.
> As we are attempting to do a slow transition from VFP to Hbr, we have many
> DBF files that have true VFP signatures. Since we are working and testing
> the files as we work with Hbr, we wanted to keep the DBF signatures
> consistent. So, this raises the following questions:
> 1. Are RDD types really used for file reading and writing but not file
> creating?
Harbour automatically recognizes type of DBF and MEMO files when table
is open. It uses signatures stored in DBF and MEMO headers for it.
RDDI_TABLETYPE and RDDI_MEMOTYPE is used only for newly create files.
rddSetDefault( "DBFCDX" )
does not change DBF signature. It only sets DBFCDX as default as default
RDD. The type of newly created DBF tables is set by:
rddInfo( RDDI_TABLETYPE, DB_DBF_VFP )
> 2. If we "use" a VFP .DBF, and we don't care about any associated index
> file(s), do we need to declare/define its type or will Harbour recognize it
> automatically.
Harbour can use any combinations of table, memo and index files.
The type of index file is controlled by used RDD: DBFCDX, DBFNTX and DBFNSX
so it's not recognized automatically but chose by programmer. DBF header
does not contain any information about used index format and index names.
> My coding skills are not as good as most here, but it seems as like
> hb_rddCreateTable() could be modified to add the database container, if the
> DBF signature specified by the RDD type were 0x30 or 0x31, without a
> significant amount of difficulty. Adding this capability might encourage
> other VFP coders to transition to Harbour as the subsequent implementation
> of .DBC files would be started for those that might need it.
I'll commit modification which reserves space for DBC name in DBF header
when new table is created with VFP signature is used. Anyhow full support
for .DBC files is a job for real VFP users. I've never used it so it's
hard to me to implement such extensions when I cannot precisely verify
real VFP behavior.
best regards,
Przemek