FWH HbSix DBF/NSX/SMT File Management

Post Reply
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

FWH HbSix DBF/NSX/SMT File Management

Post by RiazKhan »

Dear All,

I have recently converted my applications to 32 Bits. Most are working well, with some minor change in source.
Previously in my clipper 16 bit application I was using Six3 and SixNsx driver to manage the dbf files. Converting to FWH, the dbf/nsx files are managed well.
The problem is that I have some files with memo fields with are stored in SMT files. My DBF files are encrypted with password. So in general I have DBF-Database Files/NSX-Index Files/SMT-Memo Files

My request in the Main prg is as follows :

REQUEST DBFNSX
RDDREGISTER( "DBFNSX" , 1 )
RDDSETDEFAULT( "DBFNSX" )
Sx_AutoOpen(.F.)

This function SX_MemoExt() return ".SMT"

The files without memo fields open okay and seek works fine within the application.. The files with memo fields do not open in dialog. Produces an error of corruption detected.

Create index of these files produces NO errors. But when a PACK is issued withing the application, the file with memo field produces the following error..:

Error description: (Application: 38) DBFNSX/1010 Read error: \PPFNSX\PFL\PFL-1112\P1_PURS.smt
Stack Calls
===========
Called from: => __DBPACK( 0 )
Called from: .\W_623.PRG => W_6231( 78 )

and this corrupts the first record...

Any suggestion to resolve this issue....

Riaz Khan
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FWH HbSix DBF/NSX/SMT File Management

Post by Antonio Linares »

Riaz,

Have you already reported it, as you explained it here, in the Harbour developers list ?

http://groups.google.es/group/harbour-devel
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: FWH HbSix DBF/NSX/SMT File Management

Post by RiazKhan »

Hi Antonoio,

Yes, I did report it at Harbour Developers Group. They asked for a working sample, which I prepared and tested locally. It worked fine.
The sample is listed below.:
*************************************************************************************8
DbCreate( FileName , aDbf , "DBFNSX" )
DbUseArea(.T.,"DBFNSX",FileName)
FErase( FileName+'.NSX' )
Index On CODE+Str(RecNo()) TAG "P5_PFLT1"
Index On NAME+Str(RecNo()) TAG "P5_PFLT2"
DbCloseArea()
DbUseArea(.T.,"DBFNSX",FileName)
Set Index To P5_PflT
DbAppend() //Appended two records
DbUseArea(.T.,"DBFNSX",FileName)
Set Index To P5_PflT
DBSeek('PFL0002') // Is .T.
PACK // NO Error
The above worked fine. The Seek is true.....The PACK produced no error..
************************************************************************************
But If I Do This..:
File := "P1_Purs" ; cDriver := "DBFNSX"
Use (File) New VIA (cDriver) EXCLUSIVE PASSWORD (DBFPass)
Index On P_NO+DTOS(P_DT)+Str(RecNo()) TAG "P1_PURS1"
Index On DTOS(P_DT)+P_NO+Str(RecNo()) TAG "P1_PURS2"

Set Index To P1_Purs
P1_Purs->(DBSeek('0100P'))

Here The Seek is .F. And PACK produces Read Error..? The seek and PACK only fails for files having memo fields....
All my files are encrypted, the rest open and seek and pack...no erros...

Can you suggest anything.....
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FWH HbSix DBF/NSX/SMT File Management

Post by Antonio Linares »

Here The Seek is .F. And PACK produces Read Error..? The seek and PACK only fails for files having memo fields....
All my files are encrypted, the rest open and seek and pack...no erros...
What the Harbour dev list answered about this ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: FWH HbSix DBF/NSX/SMT File Management

Post by RiazKhan »

Hi Antonio,

I have posted the problem again at Harbour Developers Group.
Creating a self contained sample without password encryption worked fine. So I left it at that and did not pursue the issue. Now I have posted the sample with password encryption.
I will wait for a solution for there for the mean time..
Will keep you posted..

https://groups.google.com/group/harbour ... 048d?hl=en

Thanks and Regards
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: FWH HbSix DBF/NSX/SMT File Management

Post by RiazKhan »

Dear Antonio,


I have had no positive response from Harbour Developers Group.. A self contained sample was posted and listed below with no luck....:

****************************************************************************************************************
#Include "hbsix.ch"

FUNCTION Main( )

LOCAL hBorland
LOCAL x, aDbf[0]
LOCAL DBFPass := 'bogus'
*
FIELD P_NO

SET CENT ON
SET DATE TO BRITISH
SET EPOCH TO 1980
SET DELETED ON

REQUEST DBFNSX,DBFSMT
RDDREGISTER( "DBFNSX" , 1 )
RDDSETDEFAULT( "DBFNSX" )
Sx_AutoOpen(.F.)

aSize( aDbf, 0 )

aAdd(aDbf,{"P_NO" ,"C",05,0 })
aAdd(aDbf,{"P_APP_MS" ,"L",01,0 })
aAdd(aDbf,{"P_APP_GM" ,"L",01,0 })

Sx_DBcreate("APur.dbf" , aDbf )

Use APur New VIA "DBFNSX" PASSWORD (DBFPass)
Sx_DBFencrypt()

Index On P_NO+Str(RecNo()) TAG "APur1"
Set Index To APur

PACK // NO Errors

DbAppend()

APur->P_No := "0100P"
APur->P_App_MS := .T.
APur->P_App_GM := .F.

DbAppend()

APur->P_No := "0101P"
APur->P_App_MS := .F.
APur->P_App_GM := .T.

DbSelectAr('APur')
DbSeek('0101P') // Returns .T.

DBCloseAll()

aSize( aDbf, 0 )

aAdd(aDbf,{"P_NO" ,"C",05,0 })
aAdd(aDbf,{"P_APP_MS" ,"L",01,0 })
aAdd(aDbf,{"P_APP_GM" ,"L",01,0 })
aAdd(aDbf,{"P_Memo" ,"M",10,0 })

Sx_DBcreate("BPur.dbf" , aDbf )

Use BPur New VIA "DBFNSX" PASSWORD (DBFPass)
Sx_DBFencrypt()

Index On P_NO+Str(RecNo()) TAG "BPur1"
Set Index To BPur

PACK // NO Error Because No Encryption

DbAppend()

BPur->P_No := "0100P"
BPur->P_App_MS := .T.
BPur->P_App_GM := .F.

DbAppend()

BPur->P_No := "0101P"
BPur->P_App_MS := .F.
BPur->P_App_GM := .T.

DbSelectAr('BPur')
DbSeek('0101P') // Returns .T.

DbCloseAll()

RETURN (NIL)
************************************************************************************************************
Can you direct me, please as this is the only factor remaining of the migration process..

Regards
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
User avatar
RiazKhan
Posts: 77
Joined: Fri Dec 16, 2011 3:30 pm
Location: Pakistan

Re: FWH HbSix DBF/NSX/SMT File Management

Post by RiazKhan »

Hi All,

This is the info. from Harbour Developers Group..:
[Quote]
When I was adding support for SIX3 encryption to [x]Harbour i blocked
it for tables with memos. I made it intentionally when I found few
serious bugs in SIX3 implementation when tables with memos are encrypted.
I didn't want to replicate them and make [x]Harbour RDDs bug compatible
with SIX3 because SIX3 is corrupting data in some cases.
I left them to the moment when I'll find some spare time to precisely
document SIX3 bugs and differences in new implementation.
Meanwhile I decided to block support for SIX3 encrypted tables with
memos to not have backward compatibility problems with data created
by [x]Harbour RDDs before I'll introduce workarounds for SIX3 bugs.
[UnQuote]
FWH 20.04/Harbour3.2/Bcc7.40+/ilink32/Pelles 9.0
EMail: amriazkhan@gmail.com
Pakistan
Post Reply