Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / August 2005



Tip: Looking for answers? Try searching our database.

Can't read DBF file with VFPOLEDB driver? But can with ODBC.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Darrell Wesley - 25 Aug 2005 17:03 GMT
sThis is a strange one. I've got a VB6 program that reads a DBF file, so far
so good. I recently changed the program to use the VFPOLEDB driver version 8
and find that in some instances it does not see any data in the table,
changing the program back to the ODBC driver and magically the data shows up.

Is there any good explanation for this behavior? What types of thing should
be looked at in order to discover the problem?

Could there be an issue with the field values not matching the field
specification? (I've seen this one before- Foxpro handles it but nothing else
does)
Ralph - 25 Aug 2005 20:33 GMT
> sThis is a strange one. I've got a VB6 program that reads a DBF file, so far
> so good. I recently changed the program to use the VFPOLEDB driver version 8
[quoted text clipped - 7 lines]
> specification? (I've seen this one before- Foxpro handles it but nothing else
> does)

Check your SQL. There can occasionally be subtle differences between data
access libraries/providers/drivers. Unless your program is crashing we can
only assume it is giving you what you asked for.

-ralph
Darrell Wesley - 25 Aug 2005 21:52 GMT
The SQl is "Select * from filename"

I've tried this with Microsoft Active Data Objects 2.5, 2.7 and 2.8 all with
the same results.

Looking at the file with FoxPro there are some 100 records in it.

> > sThis is a strange one. I've got a VB6 program that reads a DBF file, so
> far
[quoted text clipped - 18 lines]
>
> -ralph
Cindy Winegarden - 26 Aug 2005 04:28 GMT
Hi Darrell,

I'm really curious! Any chance you could send me some code and a file that
duplicates the problem? I'd like to play with it.

Signature

Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com  www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden

> The SQl is "Select * from filename"
>
[quoted text clipped - 31 lines]
>>
>> -ralph
Cindy Winegarden - 27 Aug 2005 02:16 GMT
Darrell sent me his data offline. His connection string and code were fine -
I could open other tables with them, but his data appears to be corrupt.
Evidently the Fox ODBC drivers are a little more forgiving than the OLE DB
data provider.

I played with the data and was able to read his table when it had only one
record and a value of 1/"1" in each field. I was also able to read the data
when all the Numeric fields were changed to character (Fox stores Numeric
fields internally in character format), or Currency (not stored as
characters).

It appears that this particular data will need to be read via ODBC, unless
the offending item can be found.

Signature

Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com  www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden

> Hi Darrell,
>
[quoted text clipped - 37 lines]
>>>
>>> -ralph
Darrell Wesley - 29 Aug 2005 17:01 GMT
Cindy,

I found 2 fields that the data in them didn't match the field specifications
exactly.
  DISPLACE was defined as Numeric 5 wide with 2 decimals the data it
contained was like 132.6 which matched the field widt but not the decimals.
Typing values into this field interactively in a browse table showed that the
maximum value you could enter was 99.99 if you attempted to enter 132.6 it
would turn out to be 13.62.

 TOTWGT was defined as 6 wide with 1 decimal and had a value like 12733. ,
the maximum value I could enter was 9999.9.

It looks like FoxPro itself doesn't care about this and will use the
embedded decimal point similar to Fortran but other programs that use the
latest OLEDB drivers need to have data that matches the field specs exactly.
You might want to feed this back to the FoxPro team as a possible "BUG".

> Darrell sent me his data offline. His connection string and code were fine -
> I could open other tables with them, but his data appears to be corrupt.
[quoted text clipped - 51 lines]
> >>>
> >>> -ralph
Cindy Winegarden - 29 Aug 2005 22:06 GMT
Hi Darrell,

It's interesting to know what you found. You could adjust the table
structure to accommodate those out-of-range values.

I'll pass your comments along to my contacts at Microsoft.

Signature

Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com  www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden

> Cindy,
>
[quoted text clipped - 85 lines]
>> >>>
>> >>> -ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.