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: Madan Mohan_DELHI
  Where is Madan Mohan_DELHI?
 Delhi
 India
 Madan Mohan_DELHI
 Tags
Subject: RE: Import from VFP Tables to Excel/CSV
Thread ID: 372324 Message ID: 373705 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Microsoft Office Automation
Date: Monday, March 25, 2013 4:52:23 PM         
   


> >
> > I don't understand why you insist on CSV, with memo. VFP's COPY TO .. TYPE CSV doesn't support memo columns, and for good reasons.
> >
> > SQL Server can read DBF tables with all of VFP's datatypes, including Varbinary, VArchar, Double and Logical, Memo, Blob, and Memo Binary directly through VFP's OLEDB driver VFPOLEDB.DLL.
> > And an XML file would be a much better option than oldfashioned CSV.
> >
> >
> > -Anders
>
>
>
> Anders,
>
> Let me express one more time. This is the demand of business and I am okay with from DBF to EXCEL and a decision changed in the end. Let me know if I can be helped.
>
> Regards,
> Madan

Here's one way you can use autometion of Excel from VFP to let Excel read a DBF, free or in database.
The code creates an Excel worksheet from the Orders table in Northwind.dbc which is bundled with VFP.

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.



Any Excel version with the QueryTables function and capable of using OLEDB will do.

-Anders

ENTIRE THREAD

Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/7/2013 2:46:47 PM
RE: Import from VFP Tables to Excel/CSV Posted by Cetin Basoz @ 3/7/2013 4:11:46 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/25/2013 12:49:09 PM
RE: Import from VFP Tables to Excel/CSV Posted by Cetin Basoz @ 3/25/2013 1:05:00 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/25/2013 1:27:22 PM
RE: Import from VFP Tables to Excel/CSV Posted by Anders Altberg @ 3/25/2013 1:43:30 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/25/2013 1:56:13 PM
RE: Import from VFP Tables to Excel/CSV Posted by Anders Altberg @ 3/25/2013 4:52:23 PM
RE: Import from VFP Tables to Excel/CSV Posted by Cetin Basoz @ 3/25/2013 3:32:30 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/26/2013 12:08:06 PM
RE: Import from VFP Tables to Excel/CSV Posted by Tore Bleken @ 3/26/2013 12:17:01 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/26/2013 12:26:14 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/26/2013 12:32:55 PM
RE: Import from VFP Tables to Excel/CSV Posted by Tore Bleken @ 3/26/2013 12:52:14 PM
RE: Import from VFP Tables to Excel/CSV Posted by Cetin Basoz @ 3/26/2013 8:19:13 PM
RE: Import from VFP Tables to Excel/CSV Posted by Madan Mohan_DELHI @ 3/27/2013 4:57:19 AM
RE: Import from VFP Tables to Excel/CSV Posted by Cetin Basoz @ 3/27/2013 10:35:39 AM