This program gives more details on the exact error after the d4pack:
Error Number -70, 90621
int DoReindex(int argc, _TCHAR* argv[])
{
int rc=0, reindex_count=0;
USHORT options = 0;
char function[256];
char filename[256];
memset(function, 0, 256);
memset(filename, 0, 256);
if (argc != 4)
return printf("Usage: %s REINDEX TARGET COUNT.\n", argv[0]);
strcpy(filename, argv[2]);
reindex_count = atoi(argv[3]);
CODE4 settings;
code4init(&settings);
settings.accessMode = OPEN4DENY_RW;
settings.autoOpen = 1;
code4largeOn(&settings);
FILE *fpErrLog = fopen("Error.log", "w");
if (!fpErrLog)
return Re****tError("File Error.log could not be opened");
error4file(&settings, "Error.log", 0);
for (int i=1; i <= reindex_count; i++)
{
DATA4 *dbf = d4open(&settings, filename);
if (!dbf)
return HandleError(&settings, "Table %s cannot be opened.
\n", filename);
TAG4 *tag = d4tagNext(dbf, NULL);
while (tag)
{
printf("Selecting tag %s ... ", t4alias(tag));
d4tagSelect(dbf, tag);
HandleError(&settings, NULL, filename);
d4top(dbf);
HandleError(&settings, NULL, filename);
Sleep(10);
tag = d4tagNext(dbf, tag);
}
printf("Packing %s ... \n", filename);
rc = d4pack(dbf);
if (rc < 0)
return HandleError(&settings, "Table %s cannot be
packed.", filename);
/* ERROR HERE
after looping a few times (number of times before
failure varies) on same DBF file:
Error Number -70, 90621
Reading File
file4readError
*/
else
printf("Packing completed successfully.\n");
rc = d4close(dbf);
if (rc < 0)
return HandleError(&settings, NULL);
Sleep(1000);
}
fclose(fpErrLog);
code4initUndo( &settings ) ;
return 0;
}


|