Learn how to a build a cloud-first strategyRegister Now


ASP - Doesn't accept spaces in file path

Posted on 2011-10-10
Medium Priority
Last Modified: 2012-05-12
Thank you for looking at my question,

I am trying to build an intranet page that shows links to pdf files on a company's server.

The documents are resident in sub-drectory of a shared folder "Company Shared Folders/..."

The virtual directory name I have used on the web server has no spaces in it's name.

The code I am using is as follows:

Connection string

where = request("server_name")
strconn1 = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("dbase/documentation.mdb") & ";"

Query string

                  Set con = Server.CreateObject("ADODB.Connection")
                  con.Open strconn1, "", ""

                  strSQL = "SELECT * FROM tblDocumentation WHERE intCatSubNumber = " & id

                  Set rst = Server.CreateObject("ADODB.Recordset")
                  rst.Open strSQL, con, adOpenStatic, adLockReadOnly, adCmdText

                  If Not rst.EOF Then

                        Response.write("<table border=""5"" cellspacing=""0"" width=""600"" cellpadding=""0"" bordercolor=""Red"">" & vbCrLf)
                        Do While Not rst.EOF
                              Response.write("<tr>" & vbCrLf)

                              Response.write("<td align=""center""><p class=""menulink""><font size=""2""><a href=""default2.asp?id=" & rst("txtDocumentPath") & """>" & rst("txtDocumentName") & "</a></font></td>" & vbCrLf)
                              'Response.write("<td align=""center""><p class=""menulink""><font size=""2""><a href="" & rst("txtDocumentPath") & """>" & rst("txtDocumentName") & "</a></font></td>" & vbCrLf)
                              Response.write("</tr>" & vbCrLf)
                        Response.write("<tr>" & vbCrLf & "<td colspan=""2""><img border=""0"" src=""pad.gif"" width=""2"" height=""2""></td>" & vbCrLf & "</tr>" & vbCrLf & "</table>" & vbCrLf)

How do I get the system to handle the spaces in the path?

Question by:Crxfrd
1 Comment
LVL 27

Accepted Solution

Shaun Kline earned 2000 total points
ID: 36943095
Try URL encoding the document path:

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question