Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying a memo into Excel sheet
Message
From
06/10/2004 04:33:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/10/2004 21:19:32
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00949002
Message ID:
00949060
Views:
14
>Hello
>
>Using VFP7, is there a way to move large memo to Excel cell other than breaking the memo into 254 char length?
>
>Mo

There are multiple ways. One is passing a recordset:
Local oRS as AdoDB.Recordset,oRS2 as AdoDB.Recordset,oCon as AdoDB.Connection
oCon = CreateObject('ADODB.connection')
oCon.ConnectionString = "Provider=VFPOLEDB;Data Source="+_samples+"data\testdata.dbc"
oCon.Open
oRS = oCon.Execute('select * from employee')
oRs.Save('disconnectme.rst')

oRS2 = CreateObject('ADODB.Recordset')
oRs2.Open('disconnectme.rst')

oExcel = Createobject('Excel.Application')
With oExcel
  .Workbooks.Add
  .Visible = .T.
  .ActiveWorkbook.ActiveSheet.QueryTables.Add( oRS2, .Range("A1")).Refresh
Endwith
oRs2.Close
Erase 'disconnectme.rst'
Also check passing a table/view in FoxyClasses.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform