Microsoft's CopyFileEx error.

Posted on 2011-10-25
Medium Priority
Last Modified: 2012-05-12

I am using Microsoft's CopyFileEx method to copy  files.
I am coping from one server to another and the file located in share folder and i am using UNC.
i get an error 999. I was able to find the ‘999’ error on Microsoft’s Technet site. The copies are failing because of an “Error performing inpage operation.”
According to the following Microsoft kb article found at http://support.microsoft.com/kb/141117 , some of the causes of  “Error performing inpage operation” are:
“Errors caused by network connectivity can cause these errors. Mismatched MTU sizes or truncation of a packet at a router can result in this error when files larger than the largest packet size are copied over the network. In essence, the network connection is the media that has the physical problem.”

but after some investigation i saw that the file are small and I couldnt fint network issue.

I am desperate for idea...
Question by:dpatel_team
LVL 35

Accepted Solution

sarabande earned 1500 total points
ID: 37024165
the article you mentioned describes the problem:

small files copied with CopyFile (or CopyFileEx) are not really copied but are mapped to local memory as a (so-called) memory-mapped-file. unfortunately that means in your case that normal read-errors like error 2, file not found, or errors because files were opened exclusively at the server you copy from, were not reported as file errors but as memory (in)page errors.

you could try SHFileOperation as alternative to CopyFileEx though i don't know whether it can handle UNC paths on remote servers.

or you open the file with CreateFile and do the copy operation yourself.


LVL 10

Expert Comment

ID: 37025425
Would the FileSystemObject accomplish what you want?

Author Closing Comment

ID: 37029627
only provide way to debug

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

864 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