Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 26th, 2007, 11:45 PM
Authorized User
 
Join Date: Mar 2007
Location: Sydney, NSW, Australia.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check if a file exists on network

I am trying to check if a file exists within a network before running addition code to create a new (same name) file. If the file exists if will abort the next step

I am running this from vba code.
Notes 1. the file name has no extension
      2. The path is unc based ie(\\myhost\myfolder\file)

Any Help would be appreciated

Thanks
Darren

Reply With Quote
  #2 (permalink)  
Old March 27th, 2007, 06:30 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists("\\myhost\myfolder\file") Then
    Exit Sub
Else
        'do something here... do you know how to create a file?
End If


Why no extension?


mmcdonal
Reply With Quote
  #3 (permalink)  
Old March 27th, 2007, 07:15 PM
Authorized User
 
Join Date: Mar 2007
Location: Sydney, NSW, Australia.
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for that it worked a treat....... the reason for no extension is that the file is to be interfaced into a unix system.

Thanks again for your time

Cheers
Darren

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
document() - check if a file exists N.Todd XSLT 2 September 19th, 2007 05:50 AM
hei,anyone know how to check a remote file exists lsj113 C# 2005 3 November 28th, 2006 02:55 AM
Check if file starting with a pattern exists or no desperado1306 Excel VBA 1 May 30th, 2006 08:28 AM
check first to see if the file exists crmpicco Classic ASP Professional 2 December 1st, 2005 12:34 PM



All times are GMT -4. The time now is 03:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.