472,365 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,365 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 5630
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: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.