Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp2excel with memo
Message
De
17/10/2008 09:50:38
 
 
À
17/10/2008 06:32:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
Informix
Divers
Thread ID:
01355542
Message ID:
01355580
Vues:
23
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform