Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spaces in my DBQ
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Spaces in my DBQ
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01412864
Message ID:
01412864
Vues:
91
The sqlexec() errors after a successful connection handle has been created:
lcFileIn = "C:\Test\Per-Key Generic Template Sheet.xls"
lcConnstr = "Driver={Microsoft Excel Driver (*.xls)};DBQ=" + lcFileIn + ";"
lnSQLHand = SQLSTRINGCONNECT( lcConnstr )
? lnSQLHand
? SQLEXEC( lnSQLHand, 'Select * FROM "DataEntry$"', 'trt' )
The error is Connectivity error: [Microsoft][ODBC Excel Driver] The connection for viewing your linked Microsoft Excel worksheet was lost.

a copy of the file with no spaces in the filename works perfectly fine:
lcFileIn = "C:\Test\Per-KeyGenericTemplateSheet.xls"
lcConnstr = "Driver={Microsoft Excel Driver (*.xls)};DBQ=" + lcFileIn + ";"
lnSQLHand = SQLSTRINGCONNECT( lcConnstr )
? lnSQLHand
? SQLEXEC( lnSQLHand, 'Select * FROM "DataEntry$"', 'trt' )
And of course every example I can find on the web never has spaces in the path... putting it in quotes and braces has not worked either. So how does one specify spaces in their DBQ in VFP6? FWIW the code doesn't error in VFP8.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform