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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check if file exsists

Status
Not open for further replies.

MikeTom

Programmer
Aug 17, 2001
98
0
0
GB
I have an import DTS routine in visual basic that imports data from andn excel file to sql. How can i check if the file exists in the directory before i run the routine.

Thanks in advance.
 

One way is...
[tt]
If Dir(PathFileName) = vbNullString Then MsgBox "File Does Not Exist"
[/tt]

Good Luck

 
For reference... you can also use the FileSystemObject, which has a FileExists method.

:-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top