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

Exporting memo fields to Excel

Status
Not open for further replies.

amwprogg

Programmer
Jul 8, 2005
52
GB
Hi all.
I have a memo field in a DBF that holds up to 5 lines of an address. I would like to create a cursor file with the 5 extracted lines of character data and export that to an Excel file, but I seem to be having a few problems with the MLINE function. Is there a better way?
Thanks. Andy.
 
How you export your data?
With COPY TO .. XLx
or with automation?
Also there is no need to use MLINE, just ALLTRIM(this field) and replace all CR LF with CHR(10)
try this:
(suppose that the maximum lengts of that field is smaller that 256 bytes:
<pre>
SELECT Field1, field2 ..., PADR(CHRTRAN(ALLTRIM(MemField),CHR(13),[]), 255) AS MemField;
INTO CURSOR crsExport
COPY TO .... XLS
</pre>

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top