Hello,

On Thu, Feb 16, 2012 at 6:44 PM, Enrico Maria Giordano <
[email protected]> wrote:

> Dear friends, in the following sample you can see that the table TESTCOPY
> can't be decrypted using the password of the original table:
>
> #include "Dbinfo.ch"
>
>
> FUNCTION MAIN()
>
>    DBCREATE( "TESTORIG", { { "TEST", "C", 35, 0 } } )
>
>    USE TESTORIG
>
>    DBINFO( DBI_PASSWORD, "test" )
>
>    APPEND BLANK
>
>    REPLACE FIELD -> test WITH "This is a test"
>
>    ? FIELD -> test
>
>    CLOSE
>
>    DBCREATE( "TESTCOPY", { { "TEST", "C", 35, 0 } } )
>
>    USE TESTCOPY
>
>    APPEND FROM TESTORIG
>
>    CLOSE
>
>    USE TESTCOPY
>
>    DBINFO( DBI_PASSWORD, "test" )
>
>    ? FIELD -> test
>
>    CLOSE
>
>    INKEY( 0 )
>
>    RETURN NIL
>
> Any suggestions?
>
> EMG
>
> --
> EMAG Software Homepage:     http://www.emagsoftware.it
> The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum
> The Best of Spectrum Games: http://www.emagsoftware.it/tbosg
> The EMG Music page:         http://www.emagsoftware.it/emgmusic
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> xHarbour-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xharbour-developers
>


AFAIK the mentioned "password" feature is hard-coded in few bytes in the
DBF file header, and is applied to all the data rows and fields - this
old standard belongs to the early dBase tables, not to xHarbour.

As the "APPEND FROM" command does not have such "password" feature, IMHO
the data needs to be exported before being imported in other table.

The below code is working as expected.


Ella


#include "Dbinfo.ch"

FUNCTION MAIN()
    DBCREATE( "TESTORIG", { { "TEST", "C", 35, 0 } } )
    USE TESTORIG
    DBINFO( DBI_PASSWORD, "test" )
    APPEND BLANK
    REPLACE FIELD -> test WITH "This is a test"
    ? FIELD -> test
    copy to TESTTEMP
    CLOSE
    DBCREATE( "TESTCOPY", { { "TEST", "C", 35, 0 } } )
    USE TESTCOPY
    DBINFO( DBI_PASSWORD, "test" )
    APPEND FROM TESTTEMP
    CLOSE
    USE TESTCOPY
    DBINFO( DBI_PASSWORD, "test" )
    ? FIELD -> test
    CLOSE
    INKEY( 0 )
RETURN NIL
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to