---
title: "Mycket mysko sträng problem!!!"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/86579-mycket-mysko-sträng-problem"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "tonyh"
published: "2003-09-21T16:17:52.000Z"
updated: "2003-09-21T16:17:52.000Z"
replies: 0
views: 167
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/86579-mycket-mysko-sträng-problem"
---

# Mycket mysko sträng problem!!!

## #1 — tonyh, 2003-09-21T16:17Z

Hej...
Jag försöker öppna en fil genom att ange sökvägen, detta lyckas inte näg jag hämtar sökväg-strängen från databasen och skickar med som parameter till min funk.

Här nedan ser du funktionen med massa debuggnings utskrivning:

```
function ReadFile(fso, FilePath, AddonErrorMessage)
	Dim stream, FileData
	
	FilePath = trim(FilePath)
	
	Dim tempFilePath
	tempFilePath = trim("C:\inetpub\wwwroot\11054801\minWebbtesttest123456\search\templates\KTminWebb_public_search_results.html")
	Response.Write vbCrLf & "<br>--" & tempFilePath
	Response.Write vbCrLf & "<br>--" & FilePath
	Response.Write vbCrLf & "<br>DynExist?=" & fso.FileExists(FilePath)
	Response.Write vbCrLf & "<br>StatExists?=" & fso.FileExists(tempFilePath)

	if len(FilePath) = len(tempFilePath) Then
		Response.Write "<br>identical"
	else
		Response.Write "<br>diffrent<br>DynLen=" & len(FilePath) & "<br>StatLen=" & len(tempFilePath)
	end if
		
	if fso.FileExists(FilePath) then
		set stream = fso.OpenTextFile(FilePath)
		FileData = stream.ReadAll
		stream.close
		set stream = nothing
	else
		Response.Write "<br>No file found in filesystem: " & FilePath & "<br>(" & AddonErrorMessage & ")<br>"
		Response.End
	end if
	
	ReadFile = FileData
end function
```

Och för att visa att strängarna FilePath och tempFilePath verkar identiska fast av någon orsak inte är detta kan jag visa vad resultatet vart av detta(debug-info):

```
--C:\inetpub\wwwroot\11054801\minWebbtesttest123456\search\templates\KTminWebb_public_search_results.html 
--C:\inetpub\wwwroot\11054801\minWebbtesttest123456\search\templates\KTminWebb_public_search_results.html 
DynExist?=False 
StatExists?=True
diffrent
DynLen=105
StatLen=103
No file found in filesystem: C:\inetpub\wwwroot\11054801\minWebbtesttest123456\search\templates\KTminWebb_public_search_results.html 
(TemplateFile.)
```

Som ni ser så är dessa för ögat identiska men vad kan det då vara som gör så att dessa inte uppfattas lika av FileObject???

Permalänk: https://www.webforum.nu/p/86579

---

Tråden på webben: https://www.webforum.nu/amne/asp/86579-mycket-mysko-sträng-problem
