Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import Excel data
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01207090
Message ID:
01207126
Vues:
26
Hi Naomi,

Thanks for the reply. Been trying to find info on OleDbSchemaGuid which is a part of the following line of code that retrieves the sheet names:
   oXLSConnect.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, NULL)
Regards,
Arriyel

>Arryel,
>
>Check this recent thread Re: Knowing the workbook name Thread #1201694 Message #1201709
>
>If you have Excel installed, then it's easy to get sheet names. Otherwise I'm not sure. I don't know if Michel was able to solve the problem.
>
>>Hi,
>>
>>Working on an Excel data extraction project. The Excel worksheet may have several sheets that all need to read data from.
>>
>>I've gotten to the the point where I need to know the sheet names to be used for the select statement for the InitRecordset.
>>
>>Here is my sample code:
>>
>>LOCAL oXLSConnect, oRecXLS, oXLSRS
>>oXLSConnect = CREATEOBJECT('adodb.connection')
>>oXLSConnect.cConnectionString = [Provider=Microsoft.Jet.OLEDB.4.0;Data Source=] ;
>>	+ GETFILE() + [;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";]
>>oXLSConnect.Open
>>
>>oRecXLS = CREATEOBJECT('veRecHandler')   && veRecHandler is an internal class we have
>>lcSqlCmd = "select * from [" + TRIM(sheet_name) + "]"
>>oXLSRS = oRecXLS.InitRecordSet(adUseClient, adOpenStatic, adLockOptimistic, lcSqlCmd, oXLSConnect)
>>oRecXLS.Rs2Cusror(oXLSRS, "C_" + TRIM(table_name))
>>
>>
>>
>>Any help is greatly appreciated.
>>
>>Regards,
>>Ariel
Speak using soft and sweet words in case you have to eat them later.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform