![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
On Tue, 13 Jul 2004 03:22:01 -0700, "Doug Collie" <Doug Collie (AT) discussions (DOT) microsoft.com> wrote: ¤ I have an interesting problem reading data from a dbf table ¤ ¤ I can create a dbf table in excel, save it then use odbc in .net to read it - ok. ¤ ¤ I can read the same table in another (3rd party) app ok. ¤ If I change data in the table using the 3rd party app the table structure changes. ¤ Excel reads the modified table ok, the 3rd party app reads it ok but .net returns enpty objects. ¤ ¤ The problem appears to be that the (numeric) data is initially right justified in the dbf, but the 3rd party app left justifies it. ¤ ¤ I can't do anything about the 3rd party app, and need to use it ars it is. I can't find any info suggesting that dbf has a standard. ¤ ¤ Any suggestions how I can force .net to read the left justified numeric field? I doubt that the field being displayed as justified has anything to do with the how it's stored. How are you attempting to retrieve the data from the dfb? Is this a dBase database? Paul ~~~ pclement (AT) ameritech (DOT) net Microsoft MVP (Visual Basic) |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
On Wed, 14 Jul 2004 00:18:02 -0700, "Doug Collie" <Doug Collie (AT) discussions (DOT) microsoft.com> wrote: ¤ ¤ ¤ "Paul Clement" wrote: ¤ ¤ > On Tue, 13 Jul 2004 03:22:01 -0700, "Doug Collie" <Doug Collie (AT) discussions (DOT) microsoft.com> wrote: ¤ ¤ > ¤ I have an interesting problem reading data from a dbf table ¤ > ¤ ¤ > ¤ I can create a dbf table in excel, save it then use odbc in .net to read it - ok. ¤ > ¤ ¤ > ¤ I can read the same table in another (3rd party) app ok. ¤ > ¤ If I change data in the table using the 3rd party app the table structure changes. ¤ > ¤ Excel reads the modified table ok, the 3rd party app reads it ok but .net returns enpty objects. ¤ > ¤ ¤ > ¤ The problem appears to be that the (numeric) data is initially right justified in the dbf, but the 3rd party app left justifies it. ¤ > ¤ ¤ > ¤ I can't do anything about the 3rd party app, and need to use it ars it is. I can't find any info suggesting that dbf has a standard. ¤ > ¤ ¤ > ¤ Any suggestions how I can force .net to read the left justified numeric field? ¤ ¤ > I doubt that the field being displayed as justified has anything to do with the how it's stored. How ¤ > are you attempting to retrieve the data from the dfb? Is this a dBase database? ¤ ¤ ¤ > Paul ~~~ pclement (AT) ameritech (DOT) net ¤ > Microsoft MVP (Visual Basic) ¤ ¤ ¤ The problem appears to be exactly how it is stored in the dbf file. ¤ ¤ Using a binary read of the file, the dbf is structured with numeric fields (N specifier) of width 15. The version that works has the padding spaces to the left of the data in the field, the one that doesn't has the padding to the right. ¤ ¤ .net reads the data ok if I change the field specifier in the dbf to character (C specifier). But clearly I don't want to start modifying a file that I treat as read-only. ¤ ¤ They are dbase4 format (but actually very basic in structure - 2 numeric cols, no memos etc) Well it's possible that the driver you are using doesn't support the field specifier. I still don't know which driver you are using or how you are pulling in the data. Paul ~~~ pclement (AT) ameritech (DOT) net Microsoft MVP (Visual Basic) |
#6
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |