Network problems with Windows Server 2003

Post Reply
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Network problems with Windows Server 2003

Post by Marco Turco »

Hi all,
I have a really strange problem on a Windows XP workstation that read the data from a network drive hosted on Windows 2003 Server.

I - before to execute any procedure in my app - call the function CheckAccess(cFile) that is a simply function that try to open cFile in read/write mode to know if there are network connection problems.

This is the function :

function CheckAccess(cFile)
local nRetCode,handle,nError,cFile,lReturn

if file(cFile)
lReturn:=.t.
handle:=fopen(cFile,2+64)
nError:=ferror()
if nError>0
lReturn:=.f.
endif
fclose(handle)

if .not. lReturn
errore("Disk problem")
return(-1)
endif
endif
return(0)

The problem is that only on two workstation of six an error 5 (access denied) appairs making the test on a network file.
I made a lot of tests and the windows user can access to that file through Explorer and can rename and delete it.

I solved this problem casually simply adding SYSWAIT() at the beginning of that function.

My question:
Is this a FWH/xHarbor related problem or a Windows 2003 problem ?

I made a search on google and I seen some threads about random access denied problem on Windows 2003 server, is there anyone that have had the same problem ?

I am in doubt that solving the problem on this check routine I only move the problem directly on the next step (the DATA FILES) !!
Do I have to put a "syswait" before to open any files with FOPEN ?

Any ideas appreciated.

Thanks.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marco,

Where exactly have you placed the SysWait() call ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

I simply added SYSWAIT() without arguments
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Hello Marco,

Your problem looks quite strange to me. I use that function too and it runs just fine, even on Windows 2003 servers.

Could it be possible that the security settings on the server aren't correct for the user you are logged in with ? I.e. do you have access to the folder of disk you are reading or writing to ?

Regards,
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

Hi Michel,
the first test I made has been to try to delete and rename that file via the Windows "Computer resource" and I can make this.

The strange thing is that this customer has a server with Windows 2003 server, five identical workstation with windows xp and a laptop always with XP connected to the lan.

This problem appairs only on one workstation and on the laptop.
Note that the customer use the laptop also in Terminal server mode (my app is structured to work in this mode) and in this mode the problem doesn't appairs.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Marco,

Have you placed the SysWait() call in between File() and FOpen() calls ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

No, before "if file(cFile)" at the routine beginning.

SysWait()
if file(cFile)
..


I insert it there because my app can call this routine more time
so I tought to a disk cache related problem (eg. the file is still open due the previous call).

I don't know If this can be suggest you something but my app set (if needed) the windows registy to avoid network problems (oplock) using the latest Peter Rees's routines.

Source: www.softwarexp.co.uk/beta/net.zip
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London
Contact:

Post by Marco Turco »

Hi all,
It could be a domain controller related problem.

To any interested see:
www.softwarexp.co.uk/beta/search.pdf
and www.softwarexp.co.uk/beta/microsoft_support.pdf
Best Regards,

Marco Turco
SOFTWARE XP LLP
Post Reply