Solved

File Overwrite in Access VB

Posted on 2010-11-20
1
270 Views
Last Modified: 2012-05-10
I am renaming a string to move it from one directory to another, but i would like to also overwrite a file that may already exist - how can i check if it exists before i do the rename and overwrite if necessary without warnings?

Name "c:\Users\Alan\Documents\" & strFileName As "f:\Quality Systems\Change Control\Associated Documents\" & strFileName
0
Comment
Question by:SweetingA
1 Comment
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 34180495

'delete the destination file if exists with this code

if dir("f:\Quality Systems\Change Control\Associated Documents\" & strFileName)<>"" then
   kill "f:\Quality Systems\Change Control\Associated Documents\" & strFileName
end if

Name "c:\Users\Alan\Documents\" & strFileName As "f:\Quality Systems\Change Control\Associated Documents\" & strFileName
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now