Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Office 2007 compatibility issues
Message
 
À
03/02/2007 15:28:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01191826
Message ID:
01192131
Vues:
42
>>Cetin,
>>That works:
>>
>>TEXT TO lcConnString NOSHOW PRETEXT 15
>>     DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb);
>>     UID=admin;
>>     FIL=excel 12.0;
>>     DriverId=1046;
>>     DefaultDir=D:\all_zapl_4_9_0;
>>     DBQ=D:\all_zapl_4_9_0\abclist1.xlsx
>>ENDTEXT
>>
>>
>>lnSQL = SQLSTRINGCONNECT(lcConnString)
>>? lnSQL
>>SQLTABLES(lnSQL,[TABLE],[cTest])
>>SELECT cTest
>>BROWSE NORMAL
>>
>>SQLEXEC(lnSQL,[SELECT * FROM _xlnm#_FilterDatabase],[aaaa])
>>SELECT aaaa
>>BROWSE NORMAL
>>
>>
>>SQLDISCONNECT(0)
>>
>>I'll try to do the same with OLEDB
>
>
>
>That does not get me the data but seems to return the schema!?
>
>Peter

That is because I hard coded the example.
This example shows that ODBC still works :-)
You could try:
lcFile = GETFILE([XLSX])
IF EMPTY(lcFile)
   RETURN
ENDIF
lcFoder = JUSTPATH(lcFile)

TEXT TO lcConnString NOSHOW PRETEXT 15 TEXTMERGE
     DRIVER=Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb);
     UID=admin;
     FIL=excel 12.0;
     DriverId=1046;
     DefaultDir=<<lcFoder >>;
     DBQ=<<lcFile>>
ENDTEXT

lnSQL = SQLSTRINGCONNECT(lcConnString)
? lnSQL
SQLTABLES(lnSQL,[TABLE],[cTest])
SELECT cTest
BROWSE NORMAL

SQLEXEC(lnSQL,[SELECT * FROM ]+ALLTRIM(cTest.Table_Name),[aaaa])
SELECT aaaa
BROWSE NORMAL


SQLDISCONNECT(0)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform