473,382 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Disconnected mapped network drive

Hello,
Im grabbing tables via VB code using visual foxpro ODBC drives.
The tables directory is in a mapped network drive. The code works fine
and does the job, however if the computer is idle for a while the
network drive apears to have a red X on the icon and the drive becomes
disconnected. this seems to effect the VB code from grabbing the
tables. I get an error saying the specific table cannot be found. If i
manually open the mapped network drive it than becomes reconnected and
the code can find the table again.
Is there anyway the mapped network drive can always stay connected even
if it is not in use. I want to prevent this error caused by the network
drive being disconnected.
Any suggestions?
Thanks,
Gil

Nov 13 '05 #1
2 5754
On 10 Nov 2005 21:46:28 -0800, gi*******@gmail.com wrote:
Hello,
Im grabbing tables via VB code using visual foxpro ODBC drives.
The tables directory is in a mapped network drive. The code works fine
and does the job, however if the computer is idle for a while the
network drive apears to have a red X on the icon and the drive becomes
disconnected. this seems to effect the VB code from grabbing the
tables. I get an error saying the specific table cannot be found. If i
manually open the mapped network drive it than becomes reconnected and
the code can find the table again.
Is there anyway the mapped network drive can always stay connected even
if it is not in use. I want to prevent this error caused by the network
drive being disconnected.
Any suggestions?
Thanks,
Gil


I did battle with this a while back, and it's a hard one. What I finally
ended up doing is using dll calls to get the unc path the drive is mapped to,
then using the UNC path to access the tables.

I found that the API cannot be used to reliably determine whether the mapped
drive is actually connected or not, so don't be fooled into going down that
path. Since you can get the UNC path for the drive whether it's currently
connected or not, just do a little string parsing to substitute the UNC path
for the drive letter in the original path string, and you're good to go.

While we're on the subject, UNC paths are a support nightmare, no matter what
you do. People can leave drives mapped to a test copy of a database, or they
can map a drive on a system, assuming that means it's mapped for all users on
the system, while the drive mapping is actually only preserved for the user
who created the mapping. The only semi-reliable way of using mapped drives in
a multi-user environment is to user logon scripts.
Nov 13 '05 #2
I believe if you use the following on the server storing your
tables....

At a command prompt type the following:

net config server /autodisconnect:-1

The "-1" disables autodisconnect feature of the Server service.

osmethod

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AMD | last post by:
Hi, I would like to have MySQL use a mapped network drive. I'd like to do this in case there is a failure of the mysql machine, I can just replace it with a new machine pointing to the same...
5
by: Niloday | last post by:
Hi All, I am trying to access a mapped network drive from a service that I have created. The service needs to create/delete folders/files on a network drive. When I tried to connect to a...
5
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a...
2
by: createdbyx | last post by:
I am trying to make a file sync utillity to sync files between my laptop and my desktop pc. On my desktop machine (xp pro sp2) I have shared my "Visual Studio Projects" folder using windows simple...
4
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new...
2
by: =?Utf-8?B?ZGdjb29wZXI=?= | last post by:
When I get a list of drives using the Directory.GetLogicalDrives(), it gives me all drives including disconnected network drives. When I attempt to use Directory.GetDirectories() on a disconnected...
1
by: ArunRJ | last post by:
Hi All, I am new to the networking field. I recently had to share a folder in a Windows XP machine A with another XP machine B. The folder in machine A has some .xls files which I need to access...
5
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am trying to accesss a Mapped Drive from my asp.net code running on IIS 6.0. I am using a FileUpload control and fileUpload.SaveAs() to save the file to the server. I want to save the file to...
1
by: dkultasev | last post by:
Hello, I developed the program for multi use. The program reads data from the text file and puts modified data back to another file. This program was uploaded to mapped network drive. When I try...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.