Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp2excel with memo
Message
From
17/10/2008 09:50:38
 
 
To
17/10/2008 06:32:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Informix
Miscellaneous
Thread ID:
01355542
Message ID:
01355580
Views:
24
>>Hi all,
>>
>>I'm using this function to convert a dbf to xls. I have a memo field in the table but when one of its memo fields exceeds 912 characters it sticks with an OLE error(Undefined blabla). Any idea how to resolve?
>>
>>Tamas
>>
>>
>>AUTHOR BY CETIN BASOZ
>>Function VFP2Excel
>>  Lparameters tcDataSource, tcSQL, toRange
>>  Local loConn As AdoDB.Connection, ;
>>    loRS As AdoDB.Recordset,;
>>    ix
>>  loConn = Createobject("Adodb.connection")
>>  loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+m.tcDataSource
>>  loConn.Open()
>>  loRS = loConn.Execute(m.tcSQL)
>>
>>  For ix=1 To loRS.Fields.Count
>>    toRange.Offset(0,m.ix-1).Value = Proper(loRS.Fields(m.ix-1).Name)
>>    toRange.Offset(0,m.ix-1).Font.Bold = .T.
>>  Endfor
>>  toRange.Offset(1,0).CopyFromRecordSet( loRS )
>>  loRS.Close
>>  loConn.Close
>>  
>>Endfunc
>>
>
>What a familiar code. You can then use this alternative:
>
* Author: Cetin Basoz
>Function VFP2Excel
>	Lparameters tcDataSource, tcSQL, toRange
>	toRange.Parent.QueryTables.Add(;
>		"OLEDB;Provider=VFPOLEDB;Data Source="+m.tcDataSource, m.toRange, m.tcSQL).Refresh
>Endfunc
>
>Cetin

Thank you, Cetin. It works.
Sorry for not displaying the source.
I'm making it up now.

Tamas
Previous
Reply
Map
View

Click here to load this message in the networking platform