Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel OLE DB connection string
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01207361
Message ID:
01208427
Vues:
26
This message has been marked as the solution to the initial question of the thread.
Hi Naomi,

Finally got it to accept the values but I had to do it this way (see below). The one call to setting the connection string just would not work.
cFileName = ALLTRIM(GETFILE('XLS', 'Select Excel file', 'Open', 0, 'Open XLS file for import'))

oXLSConnect = CREATEOBJECT('adodb.connection')
WITH oXLSConnect
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .Properties("Extended Properties").Value = "Excel 8.0;HDR=Yes;IMEX=1"
    .Properties("Data Source").Value = cFileName
    .Open
ENDWITH
Regards,
Arriyel

>This one always prompts me for Data Source.
>
>>Hi Naomi,
>>
>>I have that one working too. I use that one to extract the sheet names.
>>
>>I use the other because I need the 'Extended Properties' to get around the PRB: Excel Values Returned as NULL Using DAO OpenRecordset (Microsoft Knowledge Base: 194124 (http://support.microsoft.com/kb/194124/EN-US/)). See also http://support.microsoft.com/kb/257819.
>>
>>Regards,
>>Arriyel
>>
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