Avatar of Gary Croxford
Gary Croxford
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

ASP - Doesn't accept spaces in file path

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)
                        
                              rst.MoveNext
                        Loop
                        
                        Response.write("<tr>" & vbCrLf & "<td colspan=""2""><img border=""0"" src=""pad.gif"" width=""2"" height=""2""></td>" & vbCrLf & "</tr>" & vbCrLf & "</table>" & vbCrLf)
                        Response.write(tempBot)

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

ASP

Avatar of undefined
Last Comment
Shaun Kline

8/22/2022 - Mon