Author |
Message |
Fan #1 / 8
|
 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 |
|
 |
Sundial Service #2 / 8
|
 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 |
|
 |
Paul Ferrar #3 / 8
|
 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 |
|
 |
Fan #4 / 8
|
 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 |
|
 |
HAEREN #5 / 8
|
 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 |
|
 |
Fan #6 / 8
|
 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 |
|
 |
PR #7 / 8
|
 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 |
|
 |
Fan #8 / 8
|
 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 |
|
|
|