File Not Found error in FileCopy

D

DavidES

I'm trying to copy a FoxPro table to a new location (overwriting an existing
copy) and then using the copy to produce reports. I have placed the following
script on the form that opens automatically in the OnOpen Event for the form.

Dim FileFrom As String
Dim FileTo As String
FileFrom = "F:\MOMWin\STOCK.dbf"
FileTo = "F:\Public\WebFiles\STOCK.dbf"
FileCopy FileFrom, FileTo

Unfortunately, I keep getting a "file not found" error. I can't figure what
I am doing wrong... any ideas?
 
D

DavidES

yes, it exists in both the FileFrom and the FileTo locations. I have checked
the spelling, use of upper/lower case, etc.
 
D

Douglas J. Steele

Just to double check, try:

Dim FileFrom As String
Dim FileTo As String

FileFrom = "F:\MOMWin\STOCK.dbf"
FileTo = "F:\Public\WebFiles\STOCK.dbf"

If Len(Dir(FileFrom)) = 0 Then
MsgBox FileFrom & " doesn't exist." & vbCrLf
Else
FileCopy FileFrom, FileTo
End If


If that doesn't work, check that F:\Public\WebFiles is correct (and that you
have permission to write there)
 
D

DavidES

Strange. It doesn't work and gives the message "Permission Denied"

But I can write, copy, save to that file all I want...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top