dbiDoRestructure 
Author Message
 dbiDoRestructure

I got 'value out of bound' error on dbase table. It turns out that i have to
change my date field to char then change it back to date. It work ok in
database desktop but i have to do this on run-time.
How can i perform this operations using dbiDoRestructure? what do i have to
do/write in table description?

Thanks



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure
It seems odd to me, Fan, that you would find no other choice but
restructure to accomplish this...  The Delphi program could, I would
think, be able to retrieve the value as the string that it is, convert
that value on-the-fly to a date with an appropriate Delphi
function-call, work with it as a date, and then convert it back for
storing into the table.

But I must be missing something here?

Quote:

> I got 'value out of bound' error on dbase table. It turns out that i have to
> change my date field to char then change it back to date. It work ok in
> database desktop but i have to do this on run-time.
> How can i perform this operations using dbiDoRestructure? what do i have to
> do/write in table description?

------------------------------------------------------------------
Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259

Quote:
> Fast(!), automatic table-repair with two clicks of the mouse!
> ChimneySweep(R):  "Click click, it's fixed!" {tm}
> http://www.sundialservices.com/products/chimneysweep



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure
You should never have to do that.  What are you trying to accomplish?

Paul / ColumbuSoft
www.columbusoft.com


Quote:
> I got 'value out of bound' error on dbase table. It turns out that i have
to
> change my date field to char then change it back to date. It work ok in
> database desktop but i have to do this on run-time.
> How can i perform this operations using dbiDoRestructure? what do i have
to
> do/write in table description?

> Thanks



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure
well i got that from delphi FAQ at borland.

Here it is:
"Translate error, value out of bounds" error with blank date
fields: What causes this error and how do I get around the problem?

Answer:
Fox Pro stores one of three things in a date field:

An actual date  (ex 19970727 is 7/27/1997)
8 Spaces (ASCII 20)
8 Zeros (ASCII 30)

All of these are acceptable to Fox Pro. The Fox Pro driver for
the BDE only accepts 1 & 2 as valid dates and returns a
translate error for the 3rd (8 ASCII zeros) as it doesn't
consider this as a valid date. To fix the problem, restructure
the date field to a char field and then restructure the table
again changing the char filed back to a date field.  This
translation writes back only valid values to the date field and
fixes the problem."

I've asked this question before and someone suggested that i use
dbiDoRestructure since delphi sql doesn't have alter table modify command
(which i've tried) .

So what do i have to do, checking all rows then convert it?


Quote:
> It seems odd to me, Fan, that you would find no other choice but
> restructure to accomplish this...  The Delphi program could, I would
> think, be able to retrieve the value as the string that it is, convert
> that value on-the-fly to a date with an appropriate Delphi
> function-call, work with it as a date, and then convert it back for
> storing into the table.

> But I must be missing something here?


> > I got 'value out of bound' error on dbase table. It turns out that i
have to
> > change my date field to char then change it back to date. It work ok in
> > database desktop but i have to do this on run-time.
> > How can i perform this operations using dbiDoRestructure? what do i have
to
> > do/write in table description?

> ------------------------------------------------------------------
> Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259

> > Fast(!), automatic table-repair with two clicks of the mouse!
> > ChimneySweep(R):  "Click click, it's fixed!" {tm}
> > http://www.sundialservices.com/products/chimneysweep



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure
The message given in this answer to a FAQ is how to deal with a
compatibility problem ONCE, giving a solution when you have to work on an
existing file which has unacceptable values for BDE to work. After having
fixed the problem your program should run normally. Unless of course someone
using Foxpro is editing the table and re-entering unacceptable values again.

Alex



Quote:
> well i got that from delphi FAQ at borland.

> Here it is:
> "Translate error, value out of bounds" error with blank date
> fields: What causes this error and how do I get around the problem?

> Answer:
> Fox Pro stores one of three things in a date field:

> An actual date  (ex 19970727 is 7/27/1997)
> 8 Spaces (ASCII 20)
> 8 Zeros (ASCII 30)

> All of these are acceptable to Fox Pro. The Fox Pro driver for
> the BDE only accepts 1 & 2 as valid dates and returns a
> translate error for the 3rd (8 ASCII zeros) as it doesn't
> consider this as a valid date. To fix the problem, restructure
> the date field to a char field and then restructure the table
> again changing the char filed back to a date field.  This
> translation writes back only valid values to the date field and
> fixes the problem."

> I've asked this question before and someone suggested that i use
> dbiDoRestructure since delphi sql doesn't have alter table modify command
> (which i've tried) .

> So what do i have to do, checking all rows then convert it?



> > It seems odd to me, Fan, that you would find no other choice but
> > restructure to accomplish this...  The Delphi program could, I would
> > think, be able to retrieve the value as the string that it is, convert
> > that value on-the-fly to a date with an appropriate Delphi
> > function-call, work with it as a date, and then convert it back for
> > storing into the table.

> > But I must be missing something here?


> > > I got 'value out of bound' error on dbase table. It turns out that i
> have to
> > > change my date field to char then change it back to date. It work ok
in
> > > database desktop but i have to do this on run-time.
> > > How can i perform this operations using dbiDoRestructure? what do i
have
> to
> > > do/write in table description?

> > ------------------------------------------------------------------
> > Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259

> > > Fast(!), automatic table-repair with two clicks of the mouse!
> > > ChimneySweep(R):  "Click click, it's fixed!" {tm}
> > > http://www.sundialservices.com/products/chimneysweep



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure

well that's exactly what i'm dealing with, existing dbf.
when the pointer reach at certain date it gives 'out of bound' error. So  i
assume the only way to fix it is altering the table, right?

i'm starting to feel a little bit desperate now :(


Quote:
> The message given in this answer to a FAQ is how to deal with a
> compatibility problem ONCE, giving a solution when you have to work on an
> existing file which has unacceptable values for BDE to work. After having
> fixed the problem your program should run normally. Unless of course
someone
> using Foxpro is editing the table and re-entering unacceptable values
again.

> Alex



> > well i got that from delphi FAQ at borland.

> > Here it is:
> > "Translate error, value out of bounds" error with blank date
> > fields: What causes this error and how do I get around the problem?

> > All of these are acceptable to Fox Pro. The Fox Pro driver for
> > the BDE only accepts 1 & 2 as valid dates and returns a
> > translate error for the 3rd (8 ASCII zeros) as it doesn't
> > consider this as a valid date. To fix the problem, restructure
> > the date field to a char field and then restructure the table
> > again changing the char filed back to a date field.  This
> > translation writes back only valid values to the date field and
> > fixes the problem."



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure

Quote:

> well that's exactly what i'm dealing with, existing dbf.
> when the pointer reach at certain date it gives 'out of bound' error. So  i
> assume the only way to fix it is altering the table, right?

> i'm starting to feel a little bit desperate now :(

Why not put the code into a try ... except ... end construct
and let the exception part handle the problematic data. Convert
it on the fly. After all you do not really want to restructure
the table but to convert the data to something which doesn't
trip up Delphi.

Peter Reber



Wed, 18 Jun 1902 08:00:00 GMT  
 dbiDoRestructure
Thanks Peter.....will try it


Quote:




Quote:

> > well that's exactly what i'm dealing with, existing dbf.
> > when the pointer reach at certain date it gives 'out of bound' error. So
i
> > assume the only way to fix it is altering the table, right?

> > i'm starting to feel a little bit desperate now :(

> Why not put the code into a try ... except ... end construct
> and let the exception part handle the problematic data. Convert
> it on the fly. After all you do not really want to restructure
> the table but to convert the data to something which doesn't
> trip up Delphi.

> Peter Reber



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Help: BDE Call to DbiDoRestructure

2. Paradox, Referential Integrity, DbiDoRestructure, SQL

3. dbiDoRestructure

4. DbiDoRestructure- Adding passwords to paradox tables

5. DbiDoRestructure Error

6. DbiDoRestructure more information?

7. DbiDoRestructure ? (Pack a Paradox table)

8. Problems with dbiDoRestructure on Password protected tables?

9. DbiDoRestructure call usage

10. DbiDoRestructure - losing master password

11. How to restructure a table with DbiDoRestructure?

12. Help!?!? DBIDoRestructure Call to reorder fields

 

 
Powered by phpBB® Forum Software