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 John Tel 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

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.
 
Try putting %20 in instead of the space...
Code:
'Z:\Extraction\TURNOVER[red]%20[/red]MPG\etc
(untested)

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
I think the problem is more like the single quotes in the pathname !
You may try this (typed, untested):
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;'" & "[highlight] [/highlight]SELECT * FROM [RFIInfo$A1:BG2]"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top