Home All Groups Group Topic Archive Search About

Accessing Foxpro Database

Author
24 Apr 2006 5:00 PM
johnsobd
I am accessing an existing Foxpro database, of which I have no control
over.  I have been successful in accessing all the tables except for
one.  This one table I can access the first 9 fields in the table, but
VB.NET will not see any fields past the first nine.  I have discovered
that the problem is the 10th field name begins with a 1.  I was able to
create a copy of this table, rename the field and can successfully
access it.  The problem is that I need to be able to access this table
in its current form.

I am using the OleDBConnection using Provider=VFPOLEDB.1.

Any help would be very much appreciated.

Thanks,

Author
24 Apr 2006 8:17 PM
BK
Without knowing any further details.... have you tried the AS clause in
your SELECT statement?  For example:

SELECT *, 1ThisColumnBlowsUp AS ThisNowWorks FROM Foo

Not sure if this will relieve your situation, but it may be worth
trying.
Author
24 Apr 2006 8:33 PM
Cindy Winegarden
Hi John,

I find it very curious that a "FoxPro" table has a column that begins with
something other than the allowed underscore or alpha characters. I can think
of three possibilities as to how this happened - it's either a DBF created
by something other than FoxPro, or it was created as an Excel spreadsheet
and saved as a DBF, or, after it was created someone changed a column name
using notepad or a Hex editor. I tried making this type of change using
Notepad and when I opened the resulting table I saw only the first column; a
situation similar to what you're seeing.

I'd contact the person who "owns" the table and ask some questions.

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegar***@msn.com  www.cindywinegarden.com


<johns***@gmail.com> wrote in message
Show quoteHide quote
news:1145898008.221558.294370@y43g2000cwc.googlegroups.com...
>I am accessing an existing Foxpro database, of which I have no control
> over.  I have been successful in accessing all the tables except for
> one.  This one table I can access the first 9 fields in the table, but
> VB.NET will not see any fields past the first nine.  I have discovered
> that the problem is the 10th field name begins with a 1.  I was able to
> create a copy of this table, rename the field and can successfully
> access it.  The problem is that I need to be able to access this table
> in its current form.
>
> I am using the OleDBConnection using Provider=VFPOLEDB.1.
>
> Any help would be very much appreciated.
>
> Thanks,
>
Author
24 Apr 2006 8:56 PM
Jeff Dillon
Might the bracket notation help? Select [field1], [1.field2] etc

Jeff
<johns***@gmail.com> wrote in message
Show quoteHide quote
news:1145898008.221558.294370@y43g2000cwc.googlegroups.com...
>I am accessing an existing Foxpro database, of which I have no control
> over.  I have been successful in accessing all the tables except for
> one.  This one table I can access the first 9 fields in the table, but
> VB.NET will not see any fields past the first nine.  I have discovered
> that the problem is the 10th field name begins with a 1.  I was able to
> create a copy of this table, rename the field and can successfully
> access it.  The problem is that I need to be able to access this table
> in its current form.
>
> I am using the OleDBConnection using Provider=VFPOLEDB.1.
>
> Any help would be very much appreciated.
>
> Thanks,
>
Author
24 Apr 2006 9:11 PM
Cindy Winegarden
Hi Jeff,

Brackets are considered string delimiters in FoxPro, so what you'd get is
columns with "field1" and "1.field2" in them. :-)

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegar***@msn.com  www.cindywinegarden.com


Show quoteHide quote
"Jeff Dillon" <jeffdil***@hotmail.com> wrote in message
news:eoo3EG%23ZGHA.4248@TK2MSFTNGP05.phx.gbl...
> Might the bracket notation help? Select [field1], [1.field2] etc
Author
25 Apr 2006 2:05 PM
frobobbo
I thank you all for your responses, but unfortunately alias don't work,
and fields seem almost invisible.  I do SELECT *, and then do a
fieldcount and only get 9, rather than the expected 120.  I could be
mistaken about the DB being FoxPro, but I have tried all diferent Data
Providers and the FoxPro one was the only one that could access it.

I have attempted to contact the creator, but it is a retail recipe
software, and I am creating a new GUI for a touchscreen.  They have not
responed to me, Yet (I am still hopeful).  Are there any other data
providers that might be able to overlook the fields beginning with
numbers?
Author
25 Apr 2006 2:12 PM
frobobbo
As a matter of additional info, I have even tried to do an Import with
MS Access 2003, and it too will only show the first 9 fields.  I have
downloaded a free DBF Viewer, and it will show all fields.
Author
25 Apr 2006 2:47 PM
Cindy Winegarden
Hi John,

Basically you've got a corrupt table. If you only need this one table and
one time only I'd use the DBF Viewer to save it into another format and then
change the field name. Otherwise I'd contact the vendor to get a fresh copy
of the table.

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegar***@msn.com  www.cindywinegarden.com


Show quoteHide quote
"frobobbo" <johns***@gmail.com> wrote in message
news:1145974324.776517.239240@g10g2000cwb.googlegroups.com...
> As a matter of additional info, I have even tried to do an Import with
> MS Access 2003, and it too will only show the first 9 fields.  I have
> downloaded a free DBF Viewer, and it will show all fields.
>
Author
25 Apr 2006 3:39 PM
frobobbo
Cindy,

Well, I don't beleive the table is corrupt, that is just what the
vendor decided to name the fields.  I have installed software updates
and they are able to write successfully to the table.

I was able to convert the DB to dBaseIV and read it successfully.  The
problem is that doing so would break future updates to the retail
software.  My intent is to add to the functionality of the retail
software rather than replace it, therefore I need to keep the Database
in tact.  Is there any way to Ignore errors or something in my
connection string?

Thanks.
Author
25 Apr 2006 4:54 PM
Cindy Winegarden
Hi John,

No version of FoxPro will open a table with a field that begins with a
numeric value and see all the columns. Perhaps it is, in fact, a dBaseIV
table. If you can open it that way then I suggest you try the OLE DB
provider for Jet, specifying dBaseIV.

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegar***@msn.com  www.cindywinegarden.com


Show quoteHide quote
"frobobbo" <johns***@gmail.com> wrote in message
news:1145979564.911138.273650@j33g2000cwa.googlegroups.com...
> Cindy,
>
> Well, I don't beleive the table is corrupt, that is just what the
> vendor decided to name the fields.  I have installed software updates
> and they are able to write successfully to the table.
>
> I was able to convert the DB to dBaseIV and read it successfully.  The
> problem is that doing so would break future updates to the retail
> software.  My intent is to add to the functionality of the retail
> software rather than replace it, therefore I need to keep the Database
> in tact.  Is there any way to Ignore errors or something in my
> connection string?
>
> Thanks.
>
Author
25 Apr 2006 7:23 PM
frobobbo
Thanks, but I can't open it with dBaseIV unless I first convert the
table, which is not the ideal situation for me.  I will keep looking.
Author
2 May 2006 6:36 PM
frobobbo
So, I guess the question now is, does anybody know if free utility to
convert from a FoxPro DB to a dBaseIV DB.  I could just run a convert
on the table.

Thanks,
Author
2 May 2006 9:44 PM
Jeff Dillon
Of course before posting, you did a Google search?

FoxPro to dBaseIV conversion


Show quoteHide quote
"frobobbo" <johns***@gmail.com> wrote in message
news:1146595004.905764.309180@g10g2000cwb.googlegroups.com...
> So, I guess the question now is, does anybody know if free utility to
> convert from a FoxPro DB to a dBaseIV DB.  I could just run a convert
> on the table.
>
> Thanks,
>
Author
3 May 2006 2:52 PM
frobobbo
Yes, I searched Google.  Most programs go from DBaseIV to Foxpro, not
the other way around.  The few that do it cost mony, I am just looking
for a quick and dirty free script.
Author
3 May 2006 4:59 PM
Jeff Dillon
Aren't we all

Show quoteHide quote
"frobobbo" <johns***@gmail.com> wrote in message
news:1146667934.460915.154030@j73g2000cwa.googlegroups.com...
> Yes, I searched Google.  Most programs go from DBaseIV to Foxpro, not
> the other way around.  The few that do it cost mony, I am just looking
> for a quick and dirty free script.
>