Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY TO command cutting out MEMO Fields
Message
De
21/12/2005 17:30:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/12/2005 16:05:44
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
FoxPro Windows
Divers
Thread ID:
01079707
Message ID:
01080043
Vues:
21
>Hello,
>I have a cursor that has a MEMO field in it. When I try to copy the cursor to an Excel spreadsheet, it cuts out the MEMO field. Is there some switch in the COPY TO command that would include the MEMO field? Temporarily I am copying the MEMO field to a CHAR field, but then I can only copy text under 254 chars.
>
>Thanks,
>MAC

Mike,
Use ADO instead. ie:
Select * ;
  from (Home()+'samples\data\employee') ;
  into Cursor crsToExcel ;
  nofilter

VFP2Excel( ,"My Export") 
Function VFP2Excel
  Lparameters tcCursorName, tcSheetName
  tcCursorName = Iif(Empty(m.tcCursorName),Alias(),m.tcCursorName)
  tcSheetName = iif(empty(m.tcSheetName),"Sheet1", m.tcSheetName)
  Local loConn As AdoDB.Connection, loRS As AdoDB.Recordset,;
    lcTempRs, lcTemp, oExcel
  lcTemp = forcepath(Sys(2015)+'.dbf',sys(2023))
  lcTempRs = forcepath(Sys(2015)+'.rst',sys(2023))
  Select (m.tcCursorName)
  Copy To (m.lcTemp)
  loConn = Createobject("Adodb.connection")
  loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+sys(2023)
  loConn.Open()
  loRS = loConn.Execute("select * from "+m.lcTemp)
  loRS.Save(m.lcTempRs)
  loRS.Close
  loConn.Close
  Erase (m.lcTemp)
  loRS.Open(m.lcTempRs)

  oExcel = Createobject("Excel.Application")
  With oExcel
    .WorkBooks.Add
    .Visible = .T.
    With .ActiveWorkBook.ActiveSheet
      .Name = m.tcSheetName
      .QueryTables.Add( loRS, .Range("A1")).Refresh()
      *!*   .Range("A1").AutoFormat(8) && xlRangeAutoFormatColor2
      .Range("A1").Activate
    Endwith
  Endwith
  loRS.Close
  Erase (m.lcTempRs)
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
Répondre
Fil
Voir

Click here to load this message in the networking platform