FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posted: Wed Jan 23, 2008 04:01 PM

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.
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posted: Thu Jan 24, 2008 08:24 AM

Uwe,

read the information direct from the dbf with the low level functions fopen(), fread()

kind regards

Stefan
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posted: Thu Jan 24, 2008 10:08 AM

U. König,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 711
Joined: Thu Oct 06, 2005 09:57 PM
Re: DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posted: Thu Jan 24, 2008 10:28 AM
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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
DBF-Header-Information ( NTX or CDX ) with DBINFO ?
Posted: Thu Jan 24, 2008 11:56 AM

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.

Continue the discussion