Help! Adding field to FoxPro table in ADO
Hello,
I am adding a field to a FoxPro table through an ADO connection which uses
a Visual FoxPro driver. I am using the following statement:
"ALTER TABLE tblname ADD newfld CHAR(5) NULL"
This adds the field, but after performing this action, I can no longer open
the table in FoxPro v2.5.
Does anyone know how can I perform this operation and still allow the table
to be accessed using FoxPro 2.5?
Thanks,
Jason
[474 byte] By [
Jason] at [2007-11-10 12:48:12]

# 1 Re: Help! Adding field to FoxPro table in ADO
"Jason" <jason_d_murray@hotmail.com> wrote in message
news:3e246dcd$1@tnews.web.dev-archive.com...
>
> Does anyone know how can I perform this operation and still allow the
table
> to be accessed using FoxPro 2.5?
In my experience, I've had to use DAO to be compatible with 2.5 and before.
Might not be that much of a change. Anyway ... just a thought.
Peace
Tom Gahagan
# 2 Re: Help! Adding field to FoxPro table in ADO
Hi Jason,
There are "older" style FoxPro 2.x tables and "newer" style Visual FoxPro
tables. The Fox2x tables do not accept nulls. The default for an unfilled
C(5) field is SPACE(5).
Basically, you have to eliminate the NULL or change the table to the VFP
format.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org http://cindywinegarden.adsl.duke.edu
http://mdsn.microsoft.com/vfoxpro http://foxcentral.net
"Jason" <jason_d_murray@hotmail.com> wrote in message
news:3e246dcd$1@tnews.web.dev-archive.com...
>
> Hello,
>
> I am adding a field to a FoxPro table through an ADO connection which uses
> a Visual FoxPro driver. I am using the following statement:
>
> "ALTER TABLE tblname ADD newfld CHAR(5) NULL"
>
> This adds the field, but after performing this action, I can no longer
open
> the table in FoxPro v2.5.
>
> Does anyone know how can I perform this operation and still allow the
table
> to be accessed using FoxPro 2.5?
>
> Thanks,
> Jason
# 3 Re: Help! Adding field to FoxPro table in ADO
Cindy,
Ok... I replaced the "NOT NULL" in the SQL statement with "NULL". Then,
updated all NULLs with empty strings, and ran an "ALTER TABLE" statement
to change the field back to "NOT NULL". FoxPro 2.5 still cannot open the
table.
Any suggestions?
Thanks for you help.
Jason
"CindyWinegarden" <cindy.winegarden@mvps.org> wrote:
>Hi Jason,
>
>There are "older" style FoxPro 2.x tables and "newer" style Visual FoxPro
>tables. The Fox2x tables do not accept nulls. The default for an unfilled
>C(5) field is SPACE(5).
>
>Basically, you have to eliminate the NULL or change the table to the VFP
>format.
>
>--
>Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
>cindy.winegarden@mvps.org http://cindywinegarden.adsl.duke.edu
>http://mdsn.microsoft.com/vfoxpro http://foxcentral.net
>
>"Jason" <jason_d_murray@hotmail.com> wrote in message
>news:3e246dcd$1@tnews.web.dev-archive.com...
>>
>> Hello,
>>
>> I am adding a field to a FoxPro table through an ADO connection which
uses
>> a Visual FoxPro driver. I am using the following statement:
>>
>> "ALTER TABLE tblname ADD newfld CHAR(5) NULL"
>>
>> This adds the field, but after performing this action, I can no longer
>open
>> the table in FoxPro v2.5.
>>
>> Does anyone know how can I perform this operation and still allow the
>table
>> to be accessed using FoxPro 2.5?
>>
>> Thanks,
>> Jason
>
>
Jason at 2007-11-11 23:53:53 >

# 4 Re: Help! Adding field to FoxPro table in ADO
Jason
Fox 2.5 cannot handle nulls no matter what you do. As Cindy said, you need
to eliminate the NULL issue altogether. The field will default to spaces.
Regards
JR
"Jason" <jason_d_murray@hotmail.com> wrote in message
news:3e25a658$1@tnews.web.dev-archive.com...
>
> Cindy,
>
> Ok... I replaced the "NOT NULL" in the SQL statement with "NULL". Then,
> updated all NULLs with empty strings, and ran an "ALTER TABLE" statement
> to change the field back to "NOT NULL". FoxPro 2.5 still cannot open the
> table.
>
> Any suggestions?
>
> Thanks for you help.
> Jason
>
> "CindyWinegarden" <cindy.winegarden@mvps.org> wrote:
> >Hi Jason,
> >
> >There are "older" style FoxPro 2.x tables and "newer" style Visual FoxPro
> >tables. The Fox2x tables do not accept nulls. The default for an unfilled
> >C(5) field is SPACE(5).
> >
> >Basically, you have to eliminate the NULL or change the table to the VFP
> >format.
> >
> >--
> >Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> >cindy.winegarden@mvps.org http://cindywinegarden.adsl.duke.edu
> >http://mdsn.microsoft.com/vfoxpro http://foxcentral.net
> >
> >"Jason" <jason_d_murray@hotmail.com> wrote in message
> >news:3e246dcd$1@tnews.web.dev-archive.com...
> >>
> >> Hello,
> >>
> >> I am adding a field to a FoxPro table through an ADO connection which
> uses
> >> a Visual FoxPro driver. I am using the following statement:
> >>
> >> "ALTER TABLE tblname ADD newfld CHAR(5) NULL"
> >>
> >> This adds the field, but after performing this action, I can no longer
> >open
> >> the table in FoxPro v2.5.
> >>
> >> Does anyone know how can I perform this operation and still allow the
> >table
> >> to be accessed using FoxPro 2.5?
> >>
> >> Thanks,
> >> Jason
> >
> >
>
# 5 Re: Help! Adding field to FoxPro table in ADO
On 15 Jan 2003 10:20:08 -0800, "Jason" <jason_d_murray@hotmail.com>
wrote:
>Ok... I replaced the "NOT NULL" in the SQL statement with "NULL". Then,
>updated all NULLs with empty strings, and ran an "ALTER TABLE" statement
>to change the field back to "NOT NULL". FoxPro 2.5 still cannot open the
>table.
>
>Any suggestions?
In addition to what John told you, once the table is in VFP format,
you need to COPY TO ... TYPE FOX2X to convert it back to a table that
FoxPro 2.x can read.
Tamar