473,804 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileCopy results in runtime error 53 file not found

Bob
I'm not sure why this is happening. Using Access 2003. My code is as
follows...

Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String

strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"

FileCopy strSourceFile, strDestinationF ile

End Sub

Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combinations with the same result.

My code seems consistent with help file example syntax.

Can anyone suggest what is causing this or know a work around?

Thanks in Advance!

Bob

Feb 1 '07 #1
5 17645
Bob wrote:
I'm not sure why this is happening. Using Access 2003. My code is as
follows...

Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String

strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"

FileCopy strSourceFile, strDestinationF ile

End Sub

Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combinations with the same result.

My code seems consistent with help file example syntax.

Can anyone suggest what is causing this or know a work around?

Thanks in Advance!

Bob
In your immediate (debug) window enter
strSourceFile = "C:\Test.tx t"
? dir(strSourceFi le)

Does it return the file name or does it return a blank line? If blank,
the file can't be found.
Feb 1 '07 #2
Bob
On Feb 1, 2:01 pm, salad <o...@vinegar.c omwrote:
Bob wrote:
I'm not sure why this is happening. Using Access 2003. My code is as
follows...
Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String
strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"
FileCopy strSourceFile, strDestinationF ile
End Sub
Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combinations with the same result.
My code seems consistent with help file example syntax.
Can anyone suggest what is causing this or know a work around?
Thanks in Advance!
Bob

In your immediate (debug) window enter
strSourceFile = "C:\Test.tx t"
? dir(strSourceFi le)

Does it return the file name or does it return a blank line? If blank,
the file can't be found.- Hide quoted text -

- Show quoted text -
Thanks for getting back to me!

I did as you suggested and got a runtime error 13 - Type mismatch.

I declared strSourceFile as a String, should it be something else?

Bob

Feb 1 '07 #3
Bob wrote:
On Feb 1, 2:01 pm, salad <o...@vinegar.c omwrote:
>>Bob wrote:
>>>I'm not sure why this is happening. Using Access 2003. My code is as
follows...
>>>Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String
>> strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"
>> FileCopy strSourceFile, strDestinationF ile
>>>End Sub
>>>Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combinatio ns with the same result.
>>>My code seems consistent with help file example syntax.
>>>Can anyone suggest what is causing this or know a work around?
>>>Thanks in Advance!
>>>Bob

In your immediate (debug) window enter
strSourceFile = "C:\Test.tx t"
? dir(strSourceFi le)

Does it return the file name or does it return a blank line? If blank,
the file can't be found.- Hide quoted text -

- Show quoted text -


Thanks for getting back to me!

I did as you suggested and got a runtime error 13 - Type mismatch.

I declared strSourceFile as a String, should it be something else?

Bob
I'm not sure. In the Debug window you don't declare variables. You
have to enter each line followed by the enter key to run the line.

Your code looks fine. DOn't know why it's failing.
Feb 1 '07 #4
Bob wrote:
On Feb 1, 2:01 pm, salad <o...@vinegar.c omwrote:
>>Bob wrote:
>>>I'm not sure why this is happening. Using Access 2003. My code is as
follows...
>>>Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String
>> strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"
>> FileCopy strSourceFile, strDestinationF ile
>>>End Sub
>>>Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combinatio ns with the same result.
>>>My code seems consistent with help file example syntax.
>>>Can anyone suggest what is causing this or know a work around?
>>>Thanks in Advance!
>>>Bob

In your immediate (debug) window enter
strSourceFile = "C:\Test.tx t"
? dir(strSourceFi le)

Does it return the file name or does it return a blank line? If blank,
the file can't be found.- Hide quoted text -

- Show quoted text -


Thanks for getting back to me!

I did as you suggested and got a runtime error 13 - Type mismatch.

I declared strSourceFile as a String, should it be something else?
Try this in the Immediate window:

? Dir("c:\Test.tx t")

If the file exist then it should return "Test.txt"

--
'---------------
'John Mishefske
'---------------
Feb 1 '07 #5
Bob
On Feb 1, 3:08 pm, John Mishefske <jmishefsk...@S PAMyahoo.comwro te:
Bob wrote:
On Feb 1, 2:01 pm, salad <o...@vinegar.c omwrote:
>Bob wrote:
>>I'm not sure why this is happening. Using Access 2003. My code is as
follows...
>>Private Sub Command1_Click( )
Dim strSourceFile As String
Dim strDestinationF ile As String
> strSourceFile = "C:\Test.tx t"
strDestinationF ile = "C:\TextFile\te st2.txt"
> FileCopy strSourceFile, strDestinationF ile
>>End Sub
>>Test.txt exists and is located in the c: directory. I've also tried
different variations of the code with other directory and file
combination s with the same result.
>>My code seems consistent with help file example syntax.
>>Can anyone suggest what is causing this or know a work around?
>>Thanks in Advance!
>>Bob
>In your immediate (debug) window enter
strSourceFile = "C:\Test.tx t"
? dir(strSourceFi le)
>Does it return the file name or does it return a blank line? If blank,
the file can't be found.- Hide quoted text -
>- Show quoted text -
Thanks for getting back to me!
I did as you suggested and got a runtime error 13 - Type mismatch.
I declared strSourceFile as a String, should it be something else?

Try this in the Immediate window:

? Dir("c:\Test.tx t")

If the file exist then it should return "Test.txt"

--
'---------------
'John Mishefske
'---------------- Hide quoted text -

- Show quoted text -
This is really strange...
I went into the c:\Folder
Tools
Folder options
View
and unchecked hide extensions for known file types
Now the code operates as it should.

Feb 1 '07 #6

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

Similar topics

1
2296
by: Beryl Small | last post by:
I have a web application in Visual Studio.Net 2003. On the click event of a button on my .aspx page, I use the following FileCopy SourceFile, DestinationFil the Sourcefile is on a mapped drive (s:\) on the server it returns the error "File not found" even though the file is there. The same code in the same place works fine if the file is on the c:\ drive. Same code also works fine with the mapped server drive in .NET if a put it in a...
2
6834
by: deko | last post by:
I want to turn error handling off, then back on in a sub routine that backs up a select set of documents. For some reason, I can't seem to get this to work - Private Sub BackupDocs() On Error GoTo HandleErr strBackupDir = "C:\BackupDir" On Error GoTo 0 ' isn't this supposed to turn off error trapping?
6
5876
by: deko | last post by:
In a multi-user environment, I have a table that stores hyperlinks to documents that are stored on the machine that hosts the mdb database. The table entry looks like this: ProductDescription.htm#file:\\DBHOST\C$\Documents and Settings\Administrator\My Documents\Products\Documents\ProductDescription.htm Having the hyperlink in this format allows the document to be opened by anyone on the local area network.
9
5893
by: cantelow | last post by:
Hi. I've got a program printing multiple pdf reports, and I need to wait for completion of various associated operations- The pdf printer prints to one file, then I need to copy that where I need it, then delete the old file, repeat with the next report. I need to wait for each step to complete or I get errors due to the previous thing being open and not done yet. Is there any elegant way to do that? My FileCopy in particular has...
0
1048
by: Perdo | last post by:
I still haven't seen any solution to or alternate for copying files to/from server drive using web form button server control The FileCopy() doesn't seem to work for me. There is Login error or filenot found even if file is existing Is there any alternative ti pedo
3
2447
by: betygs | last post by:
Hi all, I´m not speak english so well, but i'll try to do it better. I have a problem with the filecopy function when i use the IP instead of a computer name. For example This sentence works ok FileCopy "\\gdl1mfg994\qualcomm\k2.pdf", "\\gdl1me090\dibujos\bety.pdf" But this doesn't work FileCopy "\\168.192.1.16\qualcomm\k2.pdf", "\\168.190.4.14\dibujos\bety.pdf" It display this error: "path not found"
0
6613
by: .nLL | last post by:
Erorr is --------------------- Microsoft VBScript runtime error '800a0046' Permission denied /a.asp, line 3 -----------------------
7
6137
by: bhughes2187 | last post by:
In my app I am creating, there is a procedure that does a file copy from the local drive to a network share. The issue I am having, is even though I have the share mapped, and I can browse to the share with no problems, when ever the procedure is run, I get a Permission Denied error. When I get this error, I click on Debug and find the line causing the error which is my file copy line. If I click continue, the code sequence finishes and the...
7
15859
by: TracyWants2Know | last post by:
Access Version: 2002 SP3 OS: MS Windows XP Professional Code from Module: Dim txtFileNameBuES As String Dim txtFileNameBuESXP As String Dim txtPathNameBuTo As String txtFileNameBuES = DLookup("", "Variables") txtFileNameBuESXP = DLookup("", "Variables")
0
9569
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
10558
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
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...
0
9130
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...
0
6844
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();...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.