Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL - Syntax question - path name with space? 1

Status
Not open for further replies.

cutestuff

Technical User
Sep 7, 2006
162
CA
hi,
I have the following sql code:

mySQL = "INSERT INTO [RFILog$] In 'Z:\Extraction\TURNOVER MPG ME\Turnover SEP\RFI'S, FCN'S, FCR'S\RFI Log\SEP_RFI_Log.xls' 'Excel 8.0;'" & "SELECT * FROM [RFIInfo$A1:BG2]"

How can I put in the path name when there are spaces in the path? I tried all combinations - and googled for answers. It keeps giving me a syntax error.

Thank you in advance.


 
It's probably not the spaces, but the apostrophes in your pathname. Try doubling them in your string:
Code:
\RFI''S, FCN''S, FCR''S

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I have had trouble with spaces before, too. For me it worked to put three quotes instead of one quote on each end of the path. But those other quotes in there are surely causing issues, too, as indicated by Greg.
 
Greg,

Thanks. YOu're right. It was the ' that was causing me so much grief. I found this out after extensive trial and error runs. I just ended up changing the folder name to remove the ' . But I will try your suggestions next time I can't change the folder name. :)

Thanks for your help though..both of you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top