473,804 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overwrite File -"Yes"

Access 2k

Exporting a Query to as an excel file. No problem.

However, I keep getting the warning that the file already exists, Overwrite
Yes/No.

Yes, I want to overwrite the file. SetWarnings On/Off has no affect.

Any suggestions appreciated.

Thanks in advance.


"And.... Exactly at which point did you consider this a good idea?"
Nov 12 '05 #1
5 16486
> Access 2k

Exporting a Query to as an excel file. No problem.

However, I keep getting the warning that the file already exists, Overwrite
Yes/No.

Yes, I want to overwrite the file. SetWarnings On/Off has no affect.

Any suggestions appreciated.


Have you considered checking to see if the filename exists and, if so, delete
the file prior to doing the export?

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2
In article <vr************ @corp.supernews .com>, "Bruce M. Thompson"
<bthmpson@big_N OSPAM_foot.com> writes:
Have you considered checking to see if the filename exists and, if so, delete
the file prior to doing the export?


I know how to check for the existance of the file. For fear of looking stupid
(not the first time) what would be the syntax for deleting the external file?
(i.e.: C:\MyDir\MyFile .xxx)

Else, I guess I could run a batch routine prior to running the Access App.

"And.... Exactly at which point did you consider this a good idea?"
Nov 12 '05 #3
"Clint Stowers" <cl*******@aol. comNoSpam> wrote in message
news:20******** *************** ****@mb-m04.aol.com...
In article <vr************ @corp.supernews .com>, "Bruce M. Thompson"
<bthmpson@big_N OSPAM_foot.com> writes:
Have you considered checking to see if the filename exists and, if so, deletethe file prior to doing the export?
I know how to check for the existance of the file. For fear of looking

stupid (not the first time) what would be the syntax for deleting the external file? (i.e.: C:\MyDir\MyFile .xxx)


Kill "path to file"

(there is no warning and it doesn't move the file to the recycle bin so use
with caution).
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #4
In article <bp************ *@ID-98015.news.uni-berlin.de>, "Rick Brandt"
<ri*********@ho tmail.com> writes:
Kill "path to file"

(there is no warning and it doesn't move the file to the recycle bin so use
with caution).


Working as advertised. Thanks.

"And.... Exactly at which point did you consider this a good idea?"
Nov 12 '05 #5
A "safer" way is to Name the file to a backup first and then write your file
out so

Where original file is C:\MyDir\MyFile .xls

' *************** *************** ***************
' Code Start
Const FILE_TARGET = "C:\MyDir\MyFil e.xls"
Const FILE_BACKUP = "C:\MyDir\MyFil e.bak"

If Len(Dir(FILE_TA RGET)) > 0 Then
If Len(Dir(FILE_BA CKUP)) > 0 Then
Kill FILE_BACKUP
End If
Name FILE_TARGET As FILE_BACKUP
End If

' Code to output the new file to FILE_TARGET
' Code End
' *************** *************** ***************

Terry
"Clint Stowers" <cl*******@aol. comNoSpam> wrote in message
news:20******** *************** ****@mb-m03.aol.com...
In article <bp************ *@ID-98015.news.uni-berlin.de>, "Rick Brandt"
<ri*********@ho tmail.com> writes:
Kill "path to file"

(there is no warning and it doesn't move the file to the recycle bin so usewith caution).


Working as advertised. Thanks.

"And.... Exactly at which point did you consider this a good idea?"

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
7495
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or No in the 'overwrite' message box? Everything I've read explains about setting the flag to bring up the overwrite prompt message box, but there's no explanation on how to read the response to it. It appears that clicking the Yes option doesn't actually overwrite the old file, so I assume I'm...
6
3280
by: Tom | last post by:
I am having trouble when I read a file and another process is trying to update it. So I need a rountine to copy a file in asp.net. Can anyone assist? Thanks Tom
2
27767
by: B-Dog | last post by:
Is there a way to make vb.net to overwrite the file when moving? Here is what I'm trying to do: If System.IO.File.Exists(dest) Then 'handle overwrite here If MessageBox.Show("Do you want to overwrite", "Overwrite File?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
8
2728
by: Peter | last post by:
I'm trying to write a proceedure that will delete a file completely off a hardrive. I just don't want to kill the file. I want to rewrite over the data with 1's and 0's 8 times. Anyone have an idea or sample source? -Peter
3
5333
by: Gene Vangampelaere | last post by:
Hi, I need to write a function that can replace some (.dll) files. That's easy to do but what if there are some files in use ? How can I replace those files ? is there a method to 'force' an overwrite ?
26
4960
by: Army1987 | last post by:
Is this a good way to check wheter a file already exists? #include <stdio.h> #include <stdlib.h> int ask(const char *prompt); typedef char filename; int main(int argc, char *argv) { FILE *in, *out;
2
1426
by: aigi | last post by:
hi! I have a question: How can I overwrite file on ftp server? I'm learning c# so please can U help me?
4
37158
by: jcor | last post by:
Hi, I have a script that convert a file, "$novo" in this case, to a 3gp file: this is part of the script: print "qual é o título da peça? (< 36 caracteres)\n"; my $titul=<STDIN>; chomp($titul);
8
11636
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to replace" dialog, the DialogResult is Cancel instead of OK. Is there something I am missing? Dim lSaveFileDialog As New SaveFileDialog
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.