Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel, VFP and OLE DB
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01386067
Message ID:
01386068
Vues:
51
Check Export or Copy TO Excel and Date Formatting Message #1383471

>I have some automation code that works with the ODBC driver, I am changing to the OLEDB driver and hitting a few problems.
>
>This is the recorded macro from Excel:
>
>With ActiveSheet.ListObjects.Add(SourceType:=0, Source:=Array( _
>    "OLEDB;Provider=VFPOLEDB.1;Data Source=C:\DEMO\DEMO.DBC;Mode=Share Deny None;Extended Properties="""";User ID=" _
>    , _
>    """"";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN=""""" _
>    ), Destination:=Range("$A$1")).QueryTable
>    .CommandType = xlCmdTable
>    .CommandText = Array("`employees`")
>    ...etc.
>
>
>I have converted to VFP as follows:
>
>loRange = loExcel.Range("A1") 
>lcConnectionString = [Provider=VFPOLEDB.1;Data Source=C:\DEMO\DEMO.DBC;Mode=Share Deny None;
Extended Properties="";User ID="";Mask Password=False;Cache Authentication=False;
Encrypt Password=False;Collating Sequence=MACHINE;DSN=""]
>loQueryTable = loExcel.ActiveSheet.ListObjects.Add(0, lcConnectionString, loRange)
>loQueryTable.CommandType = 3 &&xlCmdTable
>...etc.
>
>
>It is failing on ListObjects.Add() call with the following error:
>OLE error code 0x80070057: The parameter is incorrect.
>
>I am using VFP 9 with the VFP 9 OLE DB Driver against Excel 2007.
>
>Any pointers?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform