identify Type of DBF

identify Type of DBF

Postby Jimmy » Tue May 02, 2023 5:07 pm

hi,

does Fivewinhave a Function to identify Type of DBF :?:

i mean Header of DBF

Code: Select all  Expand view
  nHandle := FOPEN( cDbf )
   FSEEK( nHandle, 0, 0 )                                             // Move pointer to first byte
   FREAD( nHandle, @cBuffer, 1 )
   //   FCLOSE( nHandle )
   nType := ASC( cBuffer )
   FCLOSE( nHandle )

   DO CASE
      CASE nType = 2    //  02h   FoxBASE
         cDbfType = 'Foxbase'
         cDriver := "FOXCDX"
         cInxExt := "CDX"
      CASE nType = 3    //  03h   FoxBASE+/Dbase III plus, no memo
      CASE nType = 4    //* 04h   dbase IV without memofile
      CASE nType = 5    //* 05h   dbase V  without memofile
      CASE nType = 7    //* 07h   visual object for dbase III without memofile
      CASE nType = 48   //  30h   Visual FoxPro
      CASE nType = 49   //  31h   Visual FoxPro, autoincrement enabled
      CASE nType = 67   //  43h   dBASE IV SQL table files, no memo
      CASE nType = 99   //  ???
      CASE nType = 123  //* 7Bh   "dbase IV with memo
      CASE nType = 131  //  83h   FoxBASE+/dBASE III PLUS, with memo
      CASE nType = 135  //* 87h   visual object for dbase III with memofile
      CASE nType = 139  //  8Bh   dbase IV with memo
      CASE nType = 142  //* 8Eh   dbase IV with SQL table
      CASE nType = 179  //* B3h   .dbv memo and dbt memo flagship
      CASE nType = 203  //  0xCB  dBASE IV SQL table files, with memo
      CASE nType = 229  //* E5h   HiPer-Six format with SMT memo file
      CASE nType = 245  //  F5h   FoxPro 2.x (or earlier) with memo
      CASE nType = 251  //  FBh   FoxBASE
   ENDCASE

i want to SET "right" RDD to use
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: identify Type of DBF

Postby karinha » Tue May 02, 2023 6:08 pm

Sorry Jimmy, I honestly didn't understand your question. Are you referring to this? Explain better, please.

https://vivaclipper.wordpress.com/2013/07/17/c5_rddsetdefault/

https://vivaclipper.wordpress.com/2013/07/25/clipper-5-x-drivers-guide/

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7766
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: identify Type of DBF

Postby Jimmy » Tue May 02, 2023 6:32 pm

hi,
karinha wrote:didn't understand your question. Are you referring to this? Explain better, please.

i often get DBF which e.g. "Original" DBU can´t open as it have only NTX RDD as default

now i want to "identify" Type of DBF using 1st Byte of DBF Header
my Question is : does Fivewin already have a Function for it :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: identify Type of DBF

Postby Antonio Linares » Tue May 02, 2023 7:44 pm

Dear Jimmy,

As far as I remember FWH does not provide such function.

I guess Harbour should be the one to provide it, maybe it has it...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42048
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: identify Type of DBF

Postby nageswaragunupudi » Wed May 03, 2023 12:03 am

As far as (x)Harbour is concerned, we need to decide whether to open VIA "DBFNTX" or "DBFCDX".

In our functions we use this logic internally, when we open DBF internally:

Code: Select all  Expand view
if File( cFileSetExt( cDbf, "fpt" ) ) .or. File( cFileSetExt( cDbf, "cdx" ) )
  // use DBFCDX
elseif File( cFileSetExt( cDbf, "dbt" )
  // use DBFNTX
else
  // use RDDSETDEFAULT() // user's choice
endif
 

We don't need any more information than this, which is not of any practical use.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10595
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: identify Type of DBF

Postby Jimmy » Wed May 03, 2023 5:14 pm

hi,

you talk about "rights" DBF e.g. create by Fivewin

i do have DBF Files, made by Xbase++, which might be "mis-configured" DBE ( = RDD )
i also had DBF Files which just have ".DBF" Extension but are Fake, so i also use XbrHexEdit()

so my "DualGrid" Tool is not a "normal" App , i want to made a "Swiss Knife" to use with xBase ( and "more" )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], ShumingWang and 52 guests