i have been presented a sheet that contains information i need to impot into
a dbf.
i have no clue hoe to do it and keep the data straight in the table.

append from? import from? this is something i have never done. should i save
it to an sdf or txt first then bring it in to the table?

Re: Data from an xls to a dbf. by Paul

Paul
Thu Dec 01 17:40:52 CST 2005

Any of the methods you mention could work. Try them see which ones are
easier for you. Which is best depends on your circumstances.


"Tom" <Tom@discussions.microsoft.com> wrote in message
news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
>i have been presented a sheet that contains information i need to impot
>into
> a dbf.
> i have no clue hoe to do it and keep the data straight in the table.
>
> append from? import from? this is something i have never done. should i
> save
> it to an sdf or txt first then bring it in to the table?



Re: Data from an xls to a dbf. by TonySper

TonySper
Thu Dec 01 20:36:35 CST 2005

Tom,
I would be interested in how you do this. I have converted from a DBF
to Excel but not from Excel to DBF.
Going from DBF was easy as all I did was scan the database and enter
into Excel columns each field. Going from Excel to DBF would be
tricky. I think I would try converting each Excel column to field
variables one row at a time and then append the fields to the DBF one
record at a time. Then again maybe someone else has done it and can
come up with a better way. Could be converting the Excel to a text
file and then appending from that. Interesting.
TonySper

"Tom" <Tom@discussions.microsoft.com> wrote in message
news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
i have been presented a sheet that contains information i need to
impot into
a dbf.
i have no clue hoe to do it and keep the data straight in the table.

append from? import from? this is something i have never done. should
i save
it to an sdf or txt first then bring it in to the table?



Re: Data from an xls to a dbf. by man-wai

man-wai
Thu Dec 01 23:52:11 CST 2005

> append from? import from? this is something i have never done. should i save
> it to an sdf or txt first then bring it in to the table?

APPEND FROM ... TYPE XLS

V.foxpro cannot import Excel version that's too new. I think it's up
Excel 97.

--
.~. Might, Courage, Vision. Sincerity. http://www.linux-sxs.org
/ v \
/( _ )\ (Fedora Core 4) Linux 2.6.14-1.1644_FC4
^ ^ 13:51:01 up 2 days 1:27 load average: 0.01 0.01 0.00

Re: Data from an xls to a dbf. by Carsten

Carsten
Fri Dec 02 00:31:53 CST 2005

Tom,

say your Excel-Sheet has 3 columns, this shoud do:

lcExcelFile= "c:\my temp\text.xls"
CREATE CURSOR cImport (cCol1 C(10), cCol2 C(10), cCol3 C(10) )
APPEND FROM (lcExcelFile) TYPE XLS

BROWSE NOWAIT

--
Cheers
Carsten
_______________________________

"Tom" <Tom@discussions.microsoft.com> schrieb im Newsbeitrag
news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
>i have been presented a sheet that contains information i need to impot
>into
> a dbf.
> i have no clue hoe to do it and keep the data straight in the table.
>
> append from? import from? this is something i have never done. should i
> save
> it to an sdf or txt first then bring it in to the table?



Re: Data from an xls to a dbf. by Andrew

Andrew
Fri Dec 02 03:11:23 CST 2005

"Tom" <Tom@discussions.microsoft.com> wrote in message
news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
>i have been presented a sheet that contains information i need to impot
>into
> a dbf.
> i have no clue hoe to do it and keep the data straight in the table.
>
> append from? import from? this is something i have never done. should i
> save
> it to an sdf or txt first then bring it in to the table?

My personal opinion is that you experience fewest problems by saving to a
text file (eg tab delimited,) then creating a cursor in Fox with the desired
data types and widths for the Excel columns; eg:

CREATE CURSOR impdata ( ;
field1 C(40), ;
field2 N(10,2), ;
field3 D, ;
field4 L)

and finally use APPEND FROM <textfile> DELIMITED WITH TAB

The seemingly quicker "save as DBF from Excel" or "import XLS from Foxpro"
have often caused me a headache and a lot more work by creating data types I
didn't want (numbers in character fields, broken dates etc.) and stupid
widths.

Excel is nasty for saving valid DBFs (it has created illegal and duplicate
field names for me with stunning ease in the past) and when importing XLS
with FPW2.6, all fields will be character data. I expect that last point has
been addressed in later versions of Fox but for a small amount of work in
going the text way I always get exactly what I want.

--
Regards
Andrew Howell



Re: Data from an xls to a dbf. by Tom

Tom
Fri Dec 02 08:27:03 CST 2005

Andrew, after trying some of the options i have found the same, the Import
from is a nasty joke and very frustrating. i had not thought of creating a
cursor after saving to a .txt. the text file will allow me to set it up the
way i need to.

im going to give that a try.

thanks to all for you advice !!

Tom

"Andrew Howell" wrote:

> "Tom" <Tom@discussions.microsoft.com> wrote in message
> news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
> >i have been presented a sheet that contains information i need to impot
> >into
> > a dbf.
> > i have no clue hoe to do it and keep the data straight in the table.
> >
> > append from? import from? this is something i have never done. should i
> > save
> > it to an sdf or txt first then bring it in to the table?
>
> My personal opinion is that you experience fewest problems by saving to a
> text file (eg tab delimited,) then creating a cursor in Fox with the desired
> data types and widths for the Excel columns; eg:
>
> CREATE CURSOR impdata ( ;
> field1 C(40), ;
> field2 N(10,2), ;
> field3 D, ;
> field4 L)
>
> and finally use APPEND FROM <textfile> DELIMITED WITH TAB
>
> The seemingly quicker "save as DBF from Excel" or "import XLS from Foxpro"
> have often caused me a headache and a lot more work by creating data types I
> didn't want (numbers in character fields, broken dates etc.) and stupid
> widths.
>
> Excel is nasty for saving valid DBFs (it has created illegal and duplicate
> field names for me with stunning ease in the past) and when importing XLS
> with FPW2.6, all fields will be character data. I expect that last point has
> been addressed in later versions of Fox but for a small amount of work in
> going the text way I always get exactly what I want.
>
> --
> Regards
> Andrew Howell
>
>
>

Re: Data from an xls to a dbf. by cindy_winegarden

cindy_winegarden
Fri Dec 02 14:41:01 CST 2005

Hi Tom,

Please be very careful of numbers that are displayed with commas if you are
using a comma-delimited file. It's best to "clean up" the spreadsheet before
importing, unless it's something that you will do over and over. In that
case, have the person who makes the XLS do it with only the simplest
formatting.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Tom" wrote:

> Andrew, after trying some of the options i have found the same, the Import
> from is a nasty joke and very frustrating. i had not thought of creating a
> cursor after saving to a .txt. the text file will allow me to set it up the
> way i need to.
>
> im going to give that a try.
>
> thanks to all for you advice !!
>
> Tom
>
> "Andrew Howell" wrote:
>
> > "Tom" <Tom@discussions.microsoft.com> wrote in message
> > news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
> > >i have been presented a sheet that contains information i need to impot
> > >into
> > > a dbf.
> > > i have no clue hoe to do it and keep the data straight in the table.
> > >
> > > append from? import from? this is something i have never done. should i
> > > save
> > > it to an sdf or txt first then bring it in to the table?
> >
> > My personal opinion is that you experience fewest problems by saving to a
> > text file (eg tab delimited,) then creating a cursor in Fox with the desired
> > data types and widths for the Excel columns; eg:
> >
> > CREATE CURSOR impdata ( ;
> > field1 C(40), ;
> > field2 N(10,2), ;
> > field3 D, ;
> > field4 L)
> >
> > and finally use APPEND FROM <textfile> DELIMITED WITH TAB
> >
> > The seemingly quicker "save as DBF from Excel" or "import XLS from Foxpro"
> > have often caused me a headache and a lot more work by creating data types I
> > didn't want (numbers in character fields, broken dates etc.) and stupid
> > widths.
> >
> > Excel is nasty for saving valid DBFs (it has created illegal and duplicate
> > field names for me with stunning ease in the past) and when importing XLS
> > with FPW2.6, all fields will be character data. I expect that last point has
> > been addressed in later versions of Fox but for a small amount of work in
> > going the text way I always get exactly what I want.
> >
> > --
> > Regards
> > Andrew Howell
> >
> >
> >

Re: Data from an xls to a dbf. by Paul

Paul
Mon Dec 05 16:50:18 CST 2005

What I do quite often is import the XLS into a blank Access MDB using the
Access import wizard. Then export out of Access to DBase III format. I
get a lot of data from customers in Excel with memo-field length text data
and VFP's APPEND FROM can't deal with that.

-- Paul


"Tom" <Tom@discussions.microsoft.com> wrote in message
news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
>i have been presented a sheet that contains information i need to impot
>into
> a dbf.
> i have no clue hoe to do it and keep the data straight in the table.
>
> append from? import from? this is something i have never done. should i
> save
> it to an sdf or txt first then bring it in to the table?



Re: Data from an xls to a dbf. by Andrew

Andrew
Tue Dec 06 02:48:00 CST 2005

"Paul" <paule@nospam-mindspring.com> wrote in message
news:OKW0G5e%23FHA.1248@TK2MSFTNGP14.phx.gbl...
> What I do quite often is import the XLS into a blank Access MDB using the
> Access import wizard. Then export out of Access to DBase III format. I
> get a lot of data from customers in Excel with memo-field length text data
> and VFP's APPEND FROM can't deal with that.

Good point, I don't but it's something just waiting to go wrong..

--
Regards
Andrew Howell