Convert Foxpro 3.0 dbf files to 6.0 dbf files

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Yuppie » Tue, 12 Aug 2003 17:26:43


I want to convert all my old foxpro .dbf files to 6.0 .dbf
files. How can I do this in foxpro 6.0?

Regards,
Yuppies
 
 
 

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Rick Bea » Tue, 12 Aug 2003 21:52:42

Yuppies,
There is no need to "convert" a 3.0 .DBF to 6.0. While VFP 5/6/7/8 .DBFs and .DBCs have additional features, they all have the same structure. If the original tables are "free" you could add them to a database (.DBC) if that's what you have in mind.

Rick

 
 
 

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Leoni » Wed, 13 Aug 2003 23:02:31

There is a little problem. If dbf file is in dbc created by VFP3, it can be opened by VFP6 development environment, but not by VFP6 runtime

Leonid



Yuppies,
There is no need to "convert" a 3.0 .DBF to 6.0. While VFP 5/6/7/8 .DBFs and .DBCs have additional features, they all have the same structure. If the original tables are "free" you could add them to a database (.DBC) if that's what you have in mind.

Rick
 
 
 

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Rick Bea » Thu, 14 Aug 2003 00:44:50

Leonid,
I've never read or heard about this situation, have you got more details? Version of 3.0 that created it? (3.0 or 3.0b?) Service Pack level of 6.0 runtime that can't "open" it? (Original, SP 1, 2, 3, 4, 5 and/or 6?) What error message(s) do you get? Is it a specific field type or feature that causes a problem?

Rick


There is a little problem. If dbf file is in dbc created by VFP3, it can be opened by VFP6 development environment, but not by VFP6 runtime

Leonid



Yuppies,
There is no need to "convert" a 3.0 .DBF to 6.0. While VFP 5/6/7/8 .DBFs and .DBCs have additional features, they all have the same structure. If the original tables are "free" you could add them to a database (.DBC) if that's what you have in mind.

Rick
 
 
 

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Leoni » Thu, 14 Aug 2003 15:20:32

Hi,

In VFP6 dbc file object code of stored procedures has new format. You must recompile stored procedures to use it with VFP6. Development environment do it automatically (you can't use dbc in VFP3 after it). In VFP6 SP5 runtime I used something like

local m.err_op
m.err_op=.f.
on error m.err_op=.t.
open database MyBDC
on error
if m.err_op
use MyDBC.dbc in 0
select MyDBC
locate for objectname="StoredProceduresSource"
set safety off
strtofile(code,"tmp.prg")
compile tmp.prg
locate for objectname="StoredProceduresObject"
replace code with filetostr("tmp.fxp")
use
erase tmp.prg
erase tmp.fxp
open database MyDBC
set safety on
endif

Leonid
 
 
 

Convert Foxpro 3.0 dbf files to 6.0 dbf files

Post by Rick Bea » Thu, 14 Aug 2003 21:28:56

Leonid,
Isn't this exactly what the following does?
COMPILE DATABASE MyDBC

Rick


Hi,

In VFP6 dbc file object code of stored procedures has new format. You must recompile stored procedures to use it with VFP6. Development environment do it automatically (you can't use dbc in VFP3 after it). In VFP6 SP5 runtime I used something like

local m.err_op
m.err_op=.f.
on error m.err_op=.t.
open database MyBDC
on error
if m.err_op
use MyDBC.dbc in 0
select MyDBC
locate for objectname="StoredProceduresSource"
set safety off
strtofile(code,"tmp.prg")
compile tmp.prg
locate for objectname="StoredProceduresObject"
replace code with filetostr("tmp.fxp")
use
erase tmp.prg
erase tmp.fxp
open database MyDBC
set safety on
endif

Leonid