Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Type error 's is undefinded' if databases are located deeper in File-directory #29

Open
Harald66 opened this issue Jul 22, 2019 · 2 comments

Comments

@Harald66
Copy link

If the folder or the database is locate deeper in the file directory than you get a s is undefined error.
It is because the json-File has a wrong escape character like :"...folder1/folder2\database.nsf
The agent 'getDatabasesFromServer' only replace the first backslash with the function "replaceSubstring". I put a new function in it:

Public Function ReplaceSubstring3(SourceS As String) As String
	Dim SearchS As String, ReplaceS As String	
	SearchS="\"
	ReplaceS="/"	
	While InStr(SourceS, SearchS) > 0		
		SourceS = Left$(SourceS, InStr(SourceS, SearchS) -1) + ReplaceS + _
		Right$(SourceS, Len(SourceS) -InStr(SourceS, SearchS) - Len(SearchS) + 1)		
	Wend
	ReplaceSubstring3 = SourceS	
End Function

If you use this function in line 66 the json-file is ok und will work.

@Harald66 Harald66 changed the title Type error 's is undefinded' if databses are located deeper in File-directory Type error 's is undefinded' if databases are located deeper in File-directory Jul 22, 2019
@gacres
Copy link

gacres commented Jul 22, 2019 via email

@Karthikeya14
Copy link

Karthikeya14 commented Feb 10, 2021

Simple one liner is enough..
Replace(SourceS, "\", "/")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants