Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp2excel with memo
Message
De
17/10/2008 06:32:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/10/2008 04:14:06
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:
01355546
Vues:
39
This message has been marked as the solution to the initial question of the thread.
>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
>
>
>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
Ç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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform