hello ,
is anybody here who help me in foxpro. for following requirement
every week i get a table of some databse from server and i have to modify the structure of that file every time to use that file in some other application ,so i want to make a prg, who ask pls enter your file name for modification ,and that prg autopmatically modify the structure of given dbf table as per default table structure already available there . pls help me , i am in greate trouble,

hello ,
is anybody here who help me in foxpro. for following requirement
every week i get a table of some databse from server and i have to modify the structure of that file every time to use that file in some other application ,so i want to make a prg, who ask pls enter your file name for modification ,and that prg autopmatically modify the structure of given dbf table as per default table structure already available there . pls help me , i am in greate trouble,

dear jto

I am attaching the code below. ceate suitable prg file, which may solve your problem.

here it will ask you to select the .dbf file from any location. (other then .dbf is not allowed at present). The give new file name.

It should have 8 character at present.

the new file of structure same as earlier file will be genereated.

so use it and let me know at deardevang@hotmail.com

you can ask any query for foxpro

best luck
:)
devang desai

*------------------------program developed by devang desai 27 august 2006 ----------------------*
set talk off
clea
close all
store space(200) to m_path
store space(11) to m_newfile
store space(200) to mcomm0,mcomm1,mcomm2
defi popu p_india from 10,0 to 40,40 promp files like *.dbf font "arial",12
on selec popu p_india deact popup p_india

@2,0 say "program to create the new blank file from existing database file" font "arial", 16
@22,60 say "Program developed by :" font "arial", 20 colo r+/n
@25,60 say "Devang Desai - India" font "arial", 20 colo w+/n
@28,60 say "deardevang@hotmail.com" font "arial", 20 colo g+/n

@6,0 say "select the file from the menu to create the new file" font "arial", 16
acti popu p_india
m_path = prompt()
if empty(allt(m_path))
wait wind "nothing selected"
close all
return
endif
@8,0 say "Selected file : " + allt(m_path) font "arial", 16
@11,0 say "Give valid new file name (with out extension): " font "arial", 16
@11,90 get m_newfile pict "!!!!!!!!" font "arial", 16
read

if empty(allt(m_newfile)) = .f.
m_newfile = allt(m_newfile)+ ".dbf"
mcomm0 = " use "+ allt(m_path)
mcomm1 = "copy structure to " + m_newfile
select 1
&mcomm0
&mcomm1
if file(m_newfile)
@20,0 say "File created sucessfully...." font "arial", 20 colo w+/n
select 2
use &m_newfile
brow
else
@20,0 say "File can not be created..." font "arial", 20 colo r+/n
endif
endif

return

*----------------------end of program -----------------------------*

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.