Path not found 
Author Message
 Path not found

I have a vb program which connects to a network share , from where I
read the data files in the subfolders of the share.
I use the following code to map the network drive.

    sChkRetValue = Shell(sMapDriveConnect)
    DoEvents
    Sleep (2000)

     Dim sMapDriveDelete As String, sMapDriveConnect As String,
sChkRetValue As Double
     On Error GoTo ErrHandler
    sMapDriveConnect="net use L: \\ldabsesmbsrv.abc.test.com\oceansrc
pwd1/user:xyz"
    sMapDriveConnect = GetDataFromINI("GENERAL", "MapDriveConnect")
    sChkRetValue = Shell(sMapDriveConnect)
    DoEvents
    Sleep (2000)
    ConnectToNWDrive = 1
    Exit Function
ErrHandler:
    App.LogEvent "History Tool: GBP Swaption: ConnectToNWDrive -  " &
"[" & Err.Number & "] " & Err.Description
    ConnectToNWDrive = -1

Only if this is succesful I continue to folder access using the
following code.
    sFolderPath="L:\databrowser\data\Vols\Swap\test"
    Set objFileSys = New FileSystemObject
    Set objFolder = objFileSys.GetFolder(sFolderPath)
    DoEvents
    For Each objFile In objFolder.Files
        ...
    next

But I'm getting  [76] Path not found in the line where I execute
Getfolder method above.
Earlier I was getting this error in the line where I execute shell
command to map the network drive also.
I added the DoEvents and Sleep statements and it seems to work fine
now..
Please let me know a solution to fix the problem.



Fri, 16 Sep 2005 23:01:21 GMT  
 Path not found
Set WshNetwork = CreateObject("WScript.Network")
on error resume next
WshNetwork.MapNetworkDrive "Z:", \\bigmonster\c$

Try mapping with this.

--
Regards,

Michael Holzemer
No email replies please - reply in newsgroup

Quote:
> I have a vb program which connects to a network share , from where I
> read the data files in the subfolders of the share.
> I use the following code to map the network drive.

>     sChkRetValue = Shell(sMapDriveConnect)
>     DoEvents
>     Sleep (2000)

>      Dim sMapDriveDelete As String, sMapDriveConnect As String,
> sChkRetValue As Double
>      On Error GoTo ErrHandler
>     sMapDriveConnect="net use L: \\ldabsesmbsrv.abc.test.com\oceansrc
> pwd1/user:xyz"
>     sMapDriveConnect = GetDataFromINI("GENERAL", "MapDriveConnect")
>     sChkRetValue = Shell(sMapDriveConnect)
>     DoEvents
>     Sleep (2000)
>     ConnectToNWDrive = 1
>     Exit Function
> ErrHandler:
>     App.LogEvent "History Tool: GBP Swaption: ConnectToNWDrive -  " &
> "[" & Err.Number & "] " & Err.Description
>     ConnectToNWDrive = -1

> Only if this is succesful I continue to folder access using the
> following code.
>     sFolderPath="L:\databrowser\data\Vols\Swap\test"
>     Set objFileSys = New FileSystemObject
>     Set objFolder = objFileSys.GetFolder(sFolderPath)
>     DoEvents
>     For Each objFile In objFolder.Files
> ...
>     next

> But I'm getting  [76] Path not found in the line where I execute
> Getfolder method above.
> Earlier I was getting this error in the line where I execute shell
> command to map the network drive also.
> I added the DoEvents and Sleep statements and it seems to work fine
> now..
> Please let me know a solution to fix the problem.



Fri, 16 Sep 2005 23:06:57 GMT  
 Path not found
Hi,
Thanks for the help. I'll try this out.
Another strange thing I've noticed is , I get the path not found error
only when I compile the app into a VB exe.
When I'm debugging thru the vb program it works fine with my existing
code..
Thanks
-Mahesha

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Sep 2005 00:00:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Long Path Names give Runtime error 76 - Path not found

2. Long Path Names give Runtime error 76 - Path not found

3. Path not found.

4. Access '95: "Path Not Found"

5. Path Not Found Error

6. PATH NOT FOUND ???

7. path not found: 'backup.04\vbasic\menu.Frm

8. VBA: Path not found Error

9. Need Help with -Path Not Found- error message

10. Run Time error - Path Not Found - HELP!

11. path not found / illegal function call errors

12. Path Not Found Error

 

 
Powered by phpBB® Forum Software