Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Corruption in Converting from FoxPro-DOS to Visual FoxPro

Status
Not open for further replies.

theprophet

Programmer
Nov 2, 2000
16
US
i'm in the process of converting a dos-based foxpro system to vfp. when i copied the data over into a new visual foxpro table (because of the inclusion of new fields), i am getting some serious corruption in my numeric fields. the receiving visual foxpro table has valid numbers (i.e. no data type errors), but the values don't match the original data. all my numeric fields have the same structure and decimal places, but my numbers are off.

any help will be greatly appreciated.

thanks in advance,

moe
 
Can you give examples of some of the changes? If you post the original numbers and the numbers that end up in the new tables, that might help.

Ian
 
It may depend on how you are importing the records!

I had a similar problem with an import routine that uses SCATTER and GATHER. The user complained that the data after the import was not correct. After banging my head against a brick wall for a while trying to find the problem I discovered that the fields in the new table were not in the same order as the table being imported (even though it should have been), and consequently the data was 'shunted' over to the wrong fields.

If you are using INSERT INTO make sure you specify the field names as well as the values so there can be no doubt the correct values are going into the correct fields, eg:

INSERT INTO MyTable ( Field1, Field2 ) VALUES ( 1, 2)
 
Moe,
It would be useful to know how you "copied the data over". Is the data, both new and old, on a local station, or are you moving it over a network? If on a network, what's the topology that the data moved through, and when was the last time the nework was "stress" tested?

Rick
 
i used a simple replace command to extract the fields from the dos table to the visual table (both on my local machine). no scatters and i explicitly used table names in my replace statement.

again, all the fields in both tables have the same data structure and decimal places as necessary.

the only thing i'm thinking is that somehow converting from a 16bit to a 32bit system might have something to do with it, but not sure what.

i'm thinking about exporting my dos data to excel (no issues there, data integrity maintained) and then exporting to visual foxpro, but i really didn't want to go through that, especially with this system i'm working on because it has about 40 tables in the database.

thanks again,

moe

 
Have you tried simply APPENDing the records to the new table? ie:

USE NewTable
APPEND FROM OldTable

...or does this still give you the wrong result?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top