By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,291 Members | 3,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,291 IT Pros & Developers. It's quick & easy.

Accessing Foxpro Database

P: n/a
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,

Apr 24 '06 #1
Share this Question
Share on Google+
14 Replies


P: n/a
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.

Apr 24 '06 #2

P: n/a
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
ci**************@msn.com www.cindywinegarden.com
<jo******@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.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,

Apr 24 '06 #3

P: n/a
Might the bracket notation help? Select [field1], [1.field2] etc

Jeff
<jo******@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.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,

Apr 24 '06 #4

P: n/a
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
ci**************@msn.com www.cindywinegarden.com
"Jeff Dillon" <je********@hotmail.com> wrote in message
news:eo****************@TK2MSFTNGP05.phx.gbl...
Might the bracket notation help? Select [field1], [1.field2] etc

Apr 24 '06 #5

P: n/a
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?

Apr 25 '06 #6

P: n/a
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.

Apr 25 '06 #7

P: n/a
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
ci**************@msn.com www.cindywinegarden.com
"frobobbo" <jo******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.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.

Apr 25 '06 #8

P: n/a
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.

Apr 25 '06 #9

P: n/a
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
ci**************@msn.com www.cindywinegarden.com
"frobobbo" <jo******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.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.

Apr 25 '06 #10

P: n/a
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.

Apr 25 '06 #11

P: n/a
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,

May 2 '06 #12

P: n/a
Of course before posting, you did a Google search?

FoxPro to dBaseIV conversion
"frobobbo" <jo******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.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,

May 2 '06 #13

P: n/a
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.

May 3 '06 #14

P: n/a
Aren't we all

"frobobbo" <jo******@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.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.

May 3 '06 #15

This discussion thread is closed

Replies have been disabled for this discussion.