Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loacl app connecting to server - HELP1

Status
Not open for further replies.

longda

Programmer
Jul 24, 2001
66
US
I recently upgraded an application that runs a local machine that polls time clocks throughout our buildings. It saves the information to the server, but if the server goes down, the information is saved to local machine until it gets appended back to the server when it comes back up. The problem is that I wrote two api calls in the program: getlogicaldrivestrings in win32api, and wnetaddconnection in win32api. The first checks for the mapped drive letter and if it not there it will call the second and try to re-map the drive. The logins are "timepc" without any password.

The environment is win98 on the local machines and novell servers. My code works fine on my machine, but it just won't re-map the drive on the dedicated machines.

The code I'm using is:

strServer = "\\prison\sys\infoserv"
strNetworkPath = "p:\fpw004\empdata\"

intConnected = connectdrive(strServer,"", ;
substr(strNetworkPath,1,at(":",strNetworkPath)))

if intConnected = 0
if directory(strNetworkPath)
lglNetwork = .T.
else
lglNetwork = .F.
endif
else
lglNetwork = .F.
endif

Please help. I can't for the life of me figure out why it it wll work on one machine but not the other. I even checked to make sure all the dll files that are used for the api call are in "c:\windows\system\" directory and they are.

Dave Long
 
Chpicker,

When I said "dedicated machine" I meant that it is the local machine polling the time clocks.

Thanks,
Dave Long
 
These machines that poll the time clocks are also running Win98, I assume.

The only thing I can think of is that there is SOMETHING missing on the machines. I bet if you installed the VFP Development system on them they would work. Keep in mind that it might not be something missing so much as something outdated. I would trace all of your API calls and find out which DLL's they use (and which DLL's those DLL's are dependent on, and so on). Make sure they are all the right version.
 
Chpicker,
Thanks for the help, but I found my mistake. I overlooked something in the MSDN library. The syntax for the API call is:

=wnetaddconnection("\\server\share","password","drive:")

The MSDN says that the password must have a place holder even if there is no password. So I was using empty quotes as the password. Windows recognizes this and will try to reconnect the drive without using a password, but if you use .NULL. instead of using "" this makes Windows use the default password. I changed my code so that it uses .NULL. and gave it a try. Sure enough it worked like a charm.

I do appreciate your help with this, and I hope this could help others in the future.

Oh, I was using Win98 on the machines that poll the timeclocks.

Dave Long

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top