Hi guys,
I'm trying to access a file which seemingly exists, but gives me an error 5.
Here is my code:
`Strfilepath="...\query.txt"
Set DBs = currentdb()
Set fso = CreateObject("Scripting.FilesystemObject")
If fso.FileExists(strfilepath) then
Set file = fso.opentextfile(strfilepath,ForReading, false)
End if
StrSqlquery= file.readall
File.close
It's the "opentextfile" line that gives me the error.
Thanks in advance.
I'm trying to access a file which seemingly exists, but gives me an error 5.
Here is my code:
`Strfilepath="...\query.txt"
Set DBs = currentdb()
Set fso = CreateObject("Scripting.FilesystemObject")
If fso.FileExists(strfilepath) then
Set file = fso.opentextfile(strfilepath,ForReading, false)
End if
StrSqlquery= file.readall
File.close
It's the "opentextfile" line that gives me the error.
Thanks in advance.