[RESOLVED]Access, Check Dir Existence, Make Dir, CopyFile
Hello Im doing my project well with ur great help. I have a problem with checking if dir/file on Server exist. I use ODBC and my connectivy is working. I use code to check if DIR exist.
Code:
If Dir("\\Servername\Dirname\") <> "" Then
MsgBox "It Exists!"
Else
MsgBox "No Go!"
End If
It works for C:\ etc. Im really confused about that. Ofc i can see Dir's on server from explorer. Any ideas? :D
Re: Access, Check Dir Existence, Make Dir, CopyFile
you must specify to return directories as well as files
vb Code:
If Dir("\\Servername\Dirname\", vbDirectory) <> "" Then
Re: Access, Check Dir Existence, Make Dir, CopyFile
And if you don't know what it is you could try...
vb Code:
Private Sub CommandButton1_Click()
Dim sDir As String
sDir = "\\Servername\Dirname\"
If Len(Dir(sDir, vbDirectory)) Then
If (GetAttr(sDir) And vbDirectory) = vbDirectory Then
MsgBox sDir & " does exist and is a FOLDER"
Else
MsgBox sDir & " does exist and is a FILE"
End If
Else
MsgBox sDir & " does not exist as anything."
End If
End Sub
Re: Access, Check Dir Existence, Make Dir, CopyFile
Guys great work! I wonder if it can check only a dir ;)
Edit
It Can
Guys like alwyas GREAT WORK!