Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Tai Nguyen
  Where is Tai Nguyen?
 
 United States
 Tai Nguyen
 Tags
Subject: RE: Memo field
Thread ID: 310600 Message ID: 310830 # Views: 24 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Saturday, June 25, 2011 7:16:02 PM         
   


> Hi,
>
> I run this "select" statement to export the data onto the excel format.
>
> select field1, field2, left(memofield,254), field4, field5 from table into cursor tempCur
> copy to "C:\report.xls" type xl5
>
> The problem is, I can't export more than 254 characters and so what are the techniques that you are using to do this same job? Thanks.
>
> Tai Nguyen.




Excel has functions to use the universal standard language SQL for retrieving and manupulating VFP data.

Here'a and example turning the Orders.DBF in the Northwind.dbc into a spreadsheet you can then save as whatever XLS or XLSX format your customers support.
LOCAL oExcel AS Excel.APPLICATION
LOCAL oBook AS Excel.Workbook
LOCAL oSheet AS OBJECT
oExcel = CREATEOBJECT("Excel.Application")
oBook = oExcel.Workbooks.ADD
oSheet = oBook.Worksheets(1)

* 'Create the QueryTable object.
LOCAL oQryTable AS OBJECT, sNorthwind AS STRING
sNorthwind = HOME(2) +;
[NORTHWIND\NORTHWIND.DBC]
oQryTable = oSheet.QueryTables.ADD ;
("OLEDB;Provider=VFPOLEDB.1;Data Source="+sNorthwind+";", ;
oSheet.RANGE("A1"),"Select * from Orders")
oQryTable.RefreshStyle = 2 && xlInsertEntireRows = 2
oQryTable.REFRESH(.F.)
oExcel.VISIBLE=.T.


-Anders

ENTIRE THREAD

Memo field Posted by Tai Nguyen @ 6/22/2011 9:27:49 PM
RE: Memo field Posted by Cetin Basoz @ 6/22/2011 11:03:23 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 3:37:32 AM
RE: Memo field Posted by Cetin Basoz @ 6/24/2011 1:45:32 PM
RE: Memo field Posted by Yousfi Benameur @ 6/23/2011 5:52:43 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 7:59:38 PM
RE: Memo field Posted by Yousfi Benameur @ 6/23/2011 8:08:20 PM
RE: Memo field Posted by Tai Nguyen @ 6/23/2011 8:16:08 PM
RE: Memo field Posted by Anders Altberg @ 6/25/2011 7:16:02 PM