DBF-Header-Information ( NTX or CDX ) with DBINFO ?

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

DBF-Header-Information ( NTX or CDX ) with DBINFO ?

Post by ukoenig »

Hello, from Germany

I'm looking for the RDD-Header-Information of a DBF,
how the database has been created ( NTX / CDX )
I need it, because i must know,
if the DBF is converted from NTX to CDX.
Without Index and Memo, there is no way to find out.
The Information must be somewhere in the file-header.

I checked the DBINFO - Function with all parameters,
but couldn't find a Parameter, for any informations
what RDD has been used during the creation of the DBF.
When the DBF has a MEMO, i can ask for the MEMO-Type ( FPT ).
But what to do, when there is no memo and no index ?

The Parameter DBI_RDD_VERSION returns the
same for NTX and CDX => a Version No., but of what ?

Somebody knows what to do ?

Regards
U. König
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

Uwe,

read the information direct from the dbf with the low level functions fopen(), fread()
kind regards
Stefan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

U. König,

What you want to know is if it uses NTX or CDX ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Manuel Valdenebro
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Re: DBF-Header-Information ( NTX or CDX ) with DBINFO ?

Post by Manuel Valdenebro »

ukoenig wrote:Somebody knows what to do ?

FUNCTION CabDbf (cNom)
LOCAL nHnd, cBytes, nCdx, cCdx
cNom := cNom + '.dbf'

// öffnen wir die Datei exclusiv (binary)
// Abrimos el fichero en exclusiva (binario)
IF (nHnd := FOpen( cNom, 18 )) > 0

// gehe wir zu byte 28
// vamos al byte 28
FSeek( nHnd, 28 )

// beginnen wir die Variable
// iniciamos la variable
cBytes := '0'

// esen wir die Hauptpunkte der byte 28
// leemos en la cabecera el byte 28
FRead(nHnd, @cBytes, 1)
nCdx := Bin2I(cBytes)
IF nCdx = 1
cCdx := "Table CDX"
ELSE
cCdx := "NICHT CDX"
ENDI

MSGINFO ( cCdx )

FClose(nHnd)
ENDIF

RETURN nil

Entschuldigen sie bitte mein deutsch

Tschüss
Un saludo

Manuel
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Post by ukoenig »

Dear Mr. Valdenebro

Thank you very much for the function.
It works great.
It is exactly, what i need.
As a sample :
When i work with NTX and CDX together
and use a wrong RDD. i had some problems
because =>
DEFAULT = "NTX. I open a CDX-DBF
i cannot look for the ???.CDX .and. ???.FPT
the CDX - name is not the same like the DBF with no MEMO,
there was no chance to look for the type.

Regards

Uwe König
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
Post Reply