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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

visual foxpro to foxpro 2x 1

Status
Not open for further replies.

FOXPROG

Programmer
Jan 14, 2001
51
0
0
US
Can someone tell me how I can open a visual foxpro file using a oledb data provider but then be able to output a new file in the 2x format? I have to accomodate some old software the can only handle the 2x format. Any help would be appreciated. I can open the visual foxpro file with no problem but I am stumped at getting the output to 2x format. I know if I was in the foxpro environment I could simply use the "fox2x" command.
 
Have you tried using the COPY TO command with the FOX2X option?

You might want to look in the VFP Help file for COPY TO

Good Luck,
JRB-Bldr
 
I do not believe the "copy to" command is valid when opening the table using oledb.
 
If you don't have VFP to work with, you'll have to use whatever commands are available to you in the environment you are using to open the table and output it.
If it can't directly copy to a 2.x .dbf, you'll have to write it out as delimited or fixed length, then import into the 2.x table.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Foxprog,

Can you clarify ..... Are you saying that VFP won't be present on the runtime system, and you have no control over the format of the file that you receive? You need to write 2.x code to import a VFP table into a 2.x application. Is that correct?

If so, it should be an easy matter to read the file via low-level file functions (FOPEN(), FREAD() and the like). The VFP Help file has details of the file structure. It should be easy to extract the field names, and to see where each field begins and ends.

I once wrote some code to do this. If I still had it, I'd gladly give it to you, but it was more than 20 years ago.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
You need of cours USE, then COPY TO with the FOX2X option. Both USSE and COPY TO is available via OleDB.

eg execute the command 'Execscript("USE table"+chr(13)+chr(10)+"COPY TO table2x FOX2X WITH cdx")' via oledb.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top