Hi,
I'm writing an application which is intended to run as a service. Everything works fine except if I try to read a file.
When running the app as a normal application I can read the file content. As soon I start the app as a service I got the error "input past end of file".
Code is written in VB6. The error occurs in Line "Line Input #2, sLic"
sDateiName is the placeholder for the filename.
Any idea why there is a difference if I try to read files in an application or in a service?
------
Public Function ReadLicKey(ByVal Application As String) As String
On Error GoTo Errorhandling
Dim sLic As String
Dim sDateiName As String
sDateiName = Application
Open sDateiName For Input As #2
Line Input #2, sLic
Close #2
ReadLicKey = sLic
Exit Function
Errorhandling:
Close #2
Call LogError("Application in Module4", "Error getting the key. " + vbCr + Err.Description, Err.Number)
End Function
------