Welcome! Log In Create A New Profile

Advanced

Webservice, files locked: Access denied

Posted by Koen 
Webservice, files locked: Access denied
September 25, 2020 02:57PM
Hello all,

For my webservice I use multiple procedures and files.
However, One webservice has problems, if but only if I opened the file once in the HFSQL control center.
Then I have to stop the HFSQL server, delete the files and restart before it will work again.
PROCEDURE postUpdate(nCust is int)
bufTemp is Buffer = "-1"

IF HReadSeekFirst(W_Customer,Customer_id,nCust) THEN
	HReset(W_UpdateHistory)
	W_UpdateHistory.Customer_id=nCust
	HAdd(W_UpdateHistory)
	bufTemp = W_UpdateHistory.W_UpdateID
END
RESULT enCryptData(bufTemp)

The error log will produce the following error:
Process of 'Global procedure postUpdate (server)' (ServerProcedures.postUpdate), line 24
'HAdd' function, syntax 1

What happened?
Unable to open or create <C:\Temp\Data\W_UpdateHistory.fic>

System error code: 32
System error message:
Het proces heeft geen toegang tot het bestand omdat het door een ander
proces wordt gebruikt.  (translation: The proces has no access to the file as it is in use by a different proces)

Did somebody face this problem? Or has anyone some suggestions?
I already tried:
adding HMode(W_UpdateHistorie,hModeMulti) to the project code
Hreset and HUnlockFile after every procedure(as seen in postUpdateConfirmed())



Edited 3 time(s). Last edit at 09/25/2020 05:28PM by Koen.
Re: Webservice, files locked: Access denied
September 25, 2020 07:34PM
Hey

Has a web service (IIS) rights to write in c:\temp?
I would use the DATA map of the web service..
Re: Webservice, files locked: Access denied
September 27, 2020 12:24PM
Hello jtadebruin,

Thank you for your answer.
The datapath shown in my original topic was in reality different.
I do use the datapath which is corrolated to the webservice
Re: Webservice, files locked: Access denied
September 28, 2020 06:49PM
And user IUSR has rights to write in that path?
Re: Webservice, files locked: Access denied
September 29, 2020 09:14AM
Yes, the webservice does work (write records in the file)
However, when I open the file once by HFSQL Control Center, to see who wrote the file, it becomes "blocked"
And the error with "Unable to open or create" will appear when using the webservice.
Re: Webservice, files locked: Access denied
September 29, 2020 11:05AM
HIe Koen,

are you sure the webservice is opening the files in CS mode as well and not, by accident, in classic mode?
Can you post the code for opening the connection to the database before read/write data?

Arie
Re: Webservice, files locked: Access denied
September 29, 2020 12:44PM
Hi Arie,

By accident it was indeed in classic mode eye rolling smiley
Changed it, now appears to be working just fine!

Koen
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: