Link to home
Start Free TrialLog in
Avatar of y-lee
y-lee

asked on

How to convert Excel file into foxpro .DBF file?

help me.. i got foxpro file, and i wanna convert it into foxpro dbf. how can i do that?
ASKER CERTIFIED SOLUTION
Avatar of komandur
komandur

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slink9
slink9

To do this from within VFP you could use the import wizard.  It imports excel pretty well, I do it every week.
or just save it from Excel as a CSV, and append it into a table with the structure you need, csv.
John
Avatar of y-lee

ASKER

yeah u are rite, but i need to change in programmatically in vfp code, but that ok. thanx anyway
Hey, y-lee.

You would have got a better answer if you said that you want to change "programmatically".  You did not need to select answer so quickly.

#Sample Code
<------------ Sample Test Code #1 Begins ------------->
create cursor imported_data ( ;
  a C(40), b C(40), c C(40), d C(40), e C(40), ;
  f C(40), g C(40), h C(40), i C(40), j C(60) ;
  )
select imported_data
append FROM (cFileName) TYPE XL8
<------------ Sample Test Code #1 Ends ------------->

<------------ Sample Test Code #2 Begins ------------->
import from (cFileName) type xl8
<------------ Sample Test Code #2 Ends ------------->

Bye. -e2
.. or do this if you don't know the number of columns involved and the conversion to be done by excel..this should work in most version of excel.

#DEFINE xlDB4 11
xlObject = CREATEOBJECT("", "Excel.Application")
xlObject.WorkBooks.Open(<XlsFile>)
xlObject.ActiveWorkbook.SaveAs(xlsname, xlDB4)
xlObject.Quit

kannan
Another excellent suggestion by komandur.  -e2
.... and have been awarded 'C' for this <g>
I am glad that we can't get F's.  If those could be given I am sure they would be!!!  Since a C is double the points, I would guess a D would be single points and an F would give the questioner that number of points.  That sounds like a good idea.  I post a 300 point question, you give an excellent answer, I give an F and get point along with the excellent answer.