Weird problem: I'm working for a company that uses a vendor-supported
application that's based on Fox 2.6a tables. I use Fox 8, and I've
never had any problem browsing the 2.6a tables. Until today.

Occasionally a table will get corrupted; we call the vendor, and they
fix it. They did that for us this morning, and the application can now
access the table -- but I can't open it in Fox 8, I still get a message
that the table has become corrupted and needs to be repaired. But the
weirdest thing is that I can browse the table via Fox 6!

Can anyone explain how a Fox table could look OK to Fox 2.6a and Fox 6
but not to Fox 8?

Thanks for your help!

Re: Problem reading Fox 2.6a table in Fox 8 by Dan

Dan
Thu Mar 24 11:45:38 CST 2005

With each release of Fox, they've tightened down table "examination" on
opening a little bit.

SET TABLEVALIDATE TO 0 to turn this off, although you're clearly
experiencing some form of corruption. Otherwise VFP wouldn't be complaining.

Dan


Hank Mishkoff wrote:
> Weird problem: I'm working for a company that uses a vendor-supported
> application that's based on Fox 2.6a tables. I use Fox 8, and I've
> never had any problem browsing the 2.6a tables. Until today.
>
> Occasionally a table will get corrupted; we call the vendor, and they
> fix it. They did that for us this morning, and the application can now
> access the table -- but I can't open it in Fox 8, I still get a
> message that the table has become corrupted and needs to be repaired.
> But the weirdest thing is that I can browse the table via Fox 6!
>
> Can anyone explain how a Fox table could look OK to Fox 2.6a and Fox 6
> but not to Fox 8?
>
> Thanks for your help!



Re: Problem reading Fox 2.6a table in Fox 8 by Hank

Hank
Fri Mar 25 14:09:46 CST 2005

> SET TABLEVALIDATE TO 0 to turn this off, although you're clearly
> experiencing some form of corruption. Otherwise VFP wouldn't be
complaining.

Dan, I didn't even know SET TABLEVALIDATE existed -- I know it's not a
permanent fix to the problem, but as a temporary workaround it's
fantastic. THANK YOU!!


Re: Problem reading Fox 2.6a table in Fox 8 by Larry

Larry
Tue Mar 29 07:07:29 CST 2005

Hank: I ran into a similar problem, and I run this program. I can't even
remember how I found out about it, but it works for me.

* CPZERO -- Poke a codepage byte into a database header
* Copyright Microsoft Corp, 1993-2001
*
* Usage:
* DO CPZERO WITH dbfname && marks the database with
codepage 0 (i.e., no codepage)
*
* DO CPZERO WITH dbfname, codepage_number && marks the database with
specified codepage
*
* Some common valid numbers are:
* Windows 1252
* DOS 437
* International DOS 850
*

PARAMETER m.fname, m.cpbyte
IF SET("TALK") = "ON"
SET TALK OFF
m.mtalk = "ON"
ELSE
m.mtalk = "OFF"
ENDIF

#define C_TOTAL 29 && total code page numbers supported

IF PARAMETERS() < 2
m.cpbyte = 0
ENDIF

PRIVATE m.mtalk, m.vuename

#define c_buf_size 32

#define c_noopen 1
#define c_badbyte 2
#define c_notfox 3
#define c_maxerror 4

#DEFINE c_notopened_LOC "The table could not be opened."
#DEFINE c_invalid_page_LOC "Invalid code page specified."
#DEFINE c_NotFoxTable_LOC "Not a FoxPro table."

#DEFINE c_OpenTable_LOC "Table:"

m.vuename = ""

DECLARE error_array[c_maxerror]
error_array[c_noopen] = c_notopened_LOC
error_array[c_badbyte] = c_invalid_page_LOC
error_array[c_notfox] = c_NotFoxTable_LOC

DO setup
DO main
DO cleanup

PROCEDURE setup
m.vuename = SYS(2023)+"\"+SYS(3)+".VUE"
CREATE VIEW (m.vuename)


PROCEDURE cleanup
IF FILE(m.vuename)
SET VIEW TO (m.vuename)
DELETE FILE (m.vuename)
ENDIF
SET TALK &mtalk

PROCEDURE main
PRIVATE m.fp_in, m.buf, m.found_one, m.i, m.outbyte

* Set up table of code pages and DBF bytes numbers
DIMENSION cpnums[C_TOTAL,2]
cpnums[ 1,1] = 437 && MS-DOS, U.S.A.
cpnums[ 1,2] = 1
cpnums[ 2,1] = 850 && MS-DOS, International
cpnums[ 2,2] = 2
cpnums[ 3,1] = 1252 && Windows, U.S.A & West European
cpnums[ 3,2] = 3
cpnums[ 4,1] = 10000 && Macintosh, U.S.A.
cpnums[ 4,2] = 4
cpnums[ 5,1] = 852 && MS-DOS, East European
cpnums[ 5,2] = 100
cpnums[ 6,1] = 866 && MS-DOS, Russian
cpnums[ 6,2] = 101
cpnums[ 7,1] = 865 && MS-DOS, Nordic
cpnums[ 7,2] = 102
cpnums[ 8,1] = 861 && MS-DOS, Iceland
cpnums[ 8,2] = 103
cpnums[ 9,1] = 895 && MS-DOS, Kamenicky (Czech)
cpnums[ 9,2] = 104
cpnums[10,1] = 620 && MS-DOS, Mazovia (Polish)
cpnums[10,2] = 105
cpnums[11,1] = 737 && MS-DOS, Greek
cpnums[11,2] = 106
cpnums[12,1] = 857 && MS-DOS, Turkey
cpnums[12,2] = 107
cpnums[13,1] = 863 && MS-DOS, Canada
cpnums[13,2] = 108
cpnums[14,1] = 950 && Windows, Traditional Chinese
cpnums[14,2] = 120
cpnums[15,1] = 949 && Windows, Korean (Hangul)
cpnums[15,2] = 121
cpnums[16,1] = 936 && Windows, Simplified Chinese
cpnums[16,2] = 122
cpnums[17,1] = 932 && Windows, Japanese (Shift-jis)
cpnums[17,2] = 123
cpnums[18,1] = 874 && Windows, Thai
cpnums[18,2] = 124
cpnums[19,1] = 10007 && Macintosh, Russian
cpnums[19,2] = 150
cpnums[20,1] = 10029 && Macintosh, East European
cpnums[20,2] = 151
cpnums[21,1] = 10006 && Macintosh, Greek
cpnums[21,2] = 152
cpnums[22,1] = 1250 && Windows, East European
cpnums[22,2] = 200
cpnums[23,1] = 1251 && Windows, Russian
cpnums[23,2] = 201
cpnums[24,1] = 1253 && Windows, Greek
cpnums[24,2] = 203
cpnums[25,1] = 1254 && Windows, Turkish
cpnums[25,2] = 202
cpnums[26,1] = 1255 && Windows, Hebrew (Only supported on Hebrew OS)
cpnums[26,2] = 125
cpnums[27,1] = 1256 && Windows, Arabic (Only supported on Arabic OS)
cpnums[27,2] = 126
cpnums[28,1] = 1257 && Windows, Baltic
cpnums[28,2] = 204
cpnums[29,1] = 0 && No codepage mark.
cpnums[29,2] = 0

IF EMPTY(m.fname)
m.fname = getfile("DBF|SCX|VCX|FRX|LBX|MNX",c_OpenTable_LOC)
ENDIF
IF !EMPTY(m.fname)
CLOSE DATABASES
m.outbyte = m.cpbyte
m.found_one = .F.
FOR m.i = 1 TO C_TOTAL
IF m.cpbyte = cpnums[m.i,1]
m.outbyte = cpnums[m.i,2]
m.found_one = .T.
EXIT
ENDIF
ENDFOR
IF m.found_one
m.cpbyte = m.outbyte
ELSE
* Was it a valid DBF byte if it wasn't a valid code page?
FOR m.i = 1 TO C_TOTAL
IF m.cpbyte = cpnums[m.i,2]
m.found_one = .T.
ENDIF
ENDFOR
IF !m.found_one
DO errormsg WITH c_badbyte
RETURN TO cpzero
ENDIF
ENDIF

IF FILE(m.fname)
m.fp_in = FOPEN(m.fname,2)
IF m.fp_in > 0
* First check that we have a FoxPro table...
m.buf=FREAD(m.fp_in,c_buf_size)
IF (SUBSTR(m.buf,1,1) = CHR(139) OR SUBSTR(m.buf,1,1) = CHR(203);
OR SUBSTR(m.buf,31,1) != CHR(0) OR SUBSTR(m.buf,32,1) !=
CHR(0))
=fclose(m.fp_in)
DO errormsg WITH c_notfox
RETURN TO cpzero
ELSE
* Now poke the codepage id into byte 29
=FSEEK(m.fp_in,29)
=FWRITE(m.fp_in,CHR(m.cpbyte))
=FCLOSE(m.fp_in)
ENDIF
ELSE
DO errormsg WITH c_noopen
RETURN TO cpzero
ENDIF
ELSE
DO errormsg WITH c_noopen
RETURN TO cpzero
ENDIF
ENDIF


PROCEDURE errormsg
PARAMETER num
WAIT WINDOW error_array[num] NOWAIT





"Hank Mishkoff" <HMishkoff@gmail.com> wrote in message
news:1111683406.939685.22390@f14g2000cwb.googlegroups.com...
> Weird problem: I'm working for a company that uses a vendor-supported
> application that's based on Fox 2.6a tables. I use Fox 8, and I've
> never had any problem browsing the 2.6a tables. Until today.
>
> Occasionally a table will get corrupted; we call the vendor, and they
> fix it. They did that for us this morning, and the application can now
> access the table -- but I can't open it in Fox 8, I still get a message
> that the table has become corrupted and needs to be repaired. But the
> weirdest thing is that I can browse the table via Fox 6!
>
> Can anyone explain how a Fox table could look OK to Fox 2.6a and Fox 6
> but not to Fox 8?
>
> Thanks for your help!
>



Re: Problem reading Fox 2.6a table in Fox 8 by Dan

Dan
Tue Mar 29 10:38:36 CST 2005

You found it by looking in home() + "tools\cpzero". You probably found out
about it here.

<g>

Dan

Larry Alexander wrote:
> Hank: I ran into a similar problem, and I run this program. I can't
> even remember how I found out about it, but it works for me.



Re: Problem reading Fox 2.6a table in Fox 8 by Paul

Paul
Tue Apr 05 17:51:57 CDT 2005

"Hank Mishkoff" <HMishkoff@gmail.com> wrote in
news:1111683406.939685.22390@f14g2000cwb.googlegroups.com:

> Weird problem: I'm working for a company that uses a vendor-supported
> application that's based on Fox 2.6a tables. I use Fox 8, and I've
> never had any problem browsing the 2.6a tables. Until today.
>
> Occasionally a table will get corrupted; we call the vendor, and they
> fix it. They did that for us this morning, and the application can now
> access the table -- but I can't open it in Fox 8, I still get a message
> that the table has become corrupted and needs to be repaired. But the
> weirdest thing is that I can browse the table via Fox 6!
>
> Can anyone explain how a Fox table could look OK to Fox 2.6a and Fox 6
> but not to Fox 8?
>
> Thanks for your help!

Fox 7 or earlier would only give the error if the record count
or file size is less than the header record counter. But it
would ignore the problem if the file size or record count is
greater than the header record counter. This actually is
bad, since if there are valid records beyond the header
record counter they would be invisible and destroyed when adding
new records, packing, etc.

Tell the vendor to use a correct file repair utility.

-----------------------------------------------------------------
Paul Lee ........... Abri Technologies ......... http://abri.com/
'Recover' - top rated FoxPro file repair utility.
-----------------------------------------------------------------