Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 18 total
Thread Error 601
Mon, Jun 30 2008 8:38 AMPermanent Link

Francisco Fernandez
Hi. I'm writing a program to copy records from an dbf table to an elevatedb table. This is
the part of the program that has the problem:

       Tabla.FieldDefs.Update;
       while not Tabla.Eof  do begin
         TablaEd.Append;
         for g:=0 to Tabla.FieldDefs.Count -1 do begin
           try
TablaEd.fieldbyname(Tabla.FieldDefs[g].Name).AsString:=Tabla.fieldbyname(Tabla.FieldDefs[g].Name).AsString;
           except
           end;
         end;
         TablaEd.Post;
         Tabla.Next;
       end;

Tabla=Dbf table
TablaEd=ElevateDB table

the program run well but after four or five tables in a record of the middle of a table
show me the error:

ElevateDB Error #601 The table PROVEEDORES is corrupt (Invalid row number specified for
retrieval from cache)

The table PROVEEDORES is good and it has been traspased previously. At the moment of the
error the table is another one.

Sorry my "spanglish".

Thank you very muth
Mon, Jun 30 2008 10:43 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Francisco,

I don't know if this is the case, but if you just want to copy all the
records from dbf tables, without changes, to EDB tables you can use the
"BDE Migrator" included in ElevateDB.

Anyway, if this is not the case and you really need to write your own
conversion program, I have some previous questions:
- What EDB version are you using?
- You are using ".asstring" to read all fields.
  Are they all of some "character" type?


--
Fernando Dias
[Team Elevate]
Mon, Jun 30 2008 10:58 AMPermanent Link

Francisco Fernandez
Hi Fernando.

I'm using elevatedb 2.0 and i'm ussing .asstring for all fields but all fields are not
"character" type, there are currency, character and date types.
Mon, Jun 30 2008 11:11 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francisco

>I'm using elevatedb 2.0 and i'm ussing .asstring for all fields but all fields are not
>"character" type, there are currency, character and date types.

I saw that, (personally I'd use .Assign) but I'm doubtful it can be the problem.

Re-reading your post it seems that a number of tables are processed correctly and then you have this error.  So is it always the same table being processed when the error occurs?

I also think you'd be better off altering your procedure to something like:

       Tabla.FieldDefs.Update;
OK:=True;
       while not Tabla.Eof  do begin
         TablaEd.Append;
         for g:=0 to Tabla.FieldDefs.Count -1 do begin
           try
TablaEd.fieldbyname(Tabla.FieldDefs[g].Name).AsString:=Tabla.fieldbyname(Tabla.FieldDefs[g].Name).AsString;
           except
OK := False;
           end;
         end;
if OK then          TablaEd.Post else begin
TablaEd.Cancel;
report the problem here - possibly write to a log file or showmessage
end;
         Tabla.Next;
       end;

That way if it's the conversion from/to a string that's screwing the table it will be eliminated.

Roy Lambert [Team Elevate]
Mon, Jun 30 2008 12:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< the program run well but after four or five tables in a record of the
middle of a table show me the error: >>

Can you send me the source DBF table and target EDB table that is causing
this error ? (timyoung@elevatesoft.com)

Thanks,

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 30 2008 12:23 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< That way if it's the conversion from/to a string that's screwing the
table it will be eliminated. >>

There really shouldn't be any way that an AsString assignment could corrupt
a table.  It's most likely something weird, like when we had an issue with
..NET whereby the Boolean value had a different binary representation (255
instead of 1 for True).

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Jun 30 2008 12:38 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Roy,

> I saw that, (personally I'd use .Assign) but I'm doubtful it can be the problem.

I didn't think it was the cause for the problem, too.
However, if you want to preserve NULL values you can't use .asstring, or
all NULLs in source character columns will be copied as non-null empty
strings to the target table Smiley

--
Fernando Dias
[Team Elevate]
Mon, Jun 30 2008 1:30 PMPermanent Link

Francisco Fernandez
Solved!!!

I forgot the triggers associated with the table and they don't must work in the migrate
process.

Sorry for the inconveniences and thank you for all.
Mon, Jun 30 2008 2:02 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando

>I didn't think it was the cause for the problem, too.
>However, if you want to preserve NULL values you can't use .asstring, or
>all NULLs in source character columns will be copied as non-null empty
>strings to the target table Smiley

Please wash your mouth out, or better still slice your head off Smiley

Roy Lambert [Team Elevate]
Mon, Jun 30 2008 2:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Francisco,

<< I forgot the triggers associated with the table and they don't must work
in the migrate process. >>

Triggers shouldn't cause any corruption issues.  What were the triggers
doing that was causing this issue ?  It might be a bug.

--
Tim Young
Elevate Software
www.elevatesoft.com

Page 1 of 2Next Page »
Jump to Page:  1 2
Image