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

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

Postby ukoenig » Wed Jan 23, 2008 4: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby StefanHaupt » Thu Jan 24, 2008 8:24 am

Uwe,

read the information direct from the dbf with the low level functions fopen(), fread()
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42071
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Manuel Valdenebro » 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
User avatar
Manuel Valdenebro
 
Posts: 706
Joined: Thu Oct 06, 2005 9:57 pm
Location: Málaga-España

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

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