Solved

Simple filecopy in VB6 fails

Posted on 2014-10-18
2
201 Views
Last Modified: 2014-10-19
This code works fine if I watch it in the debugger one line at a time.

    tempi = folderPath + "Seagate Crystal Reports - recptasc.pdf"
    tempj = folderPath + querFind
    FileCopy tempi, tempj
    kill tempi

But if I let the code run from statements above those lines to the line after those lines, it fails.

Pulling my hair out and I don't have any to spare.  Any help appreciated.
0
Comment
Question by:Skip_Laughlin
  • 2
2 Comments
 

Author Comment

by:Skip_Laughlin
ID: 40389531
The file in question is created by Crystal reports running a pdf writer.  All that works fine.  But I need to rename the ouput file to continue with processing in my app.  It acts like there is some sort of lock on the file which prevents the copy and delete.  If there is a lock, I don't know what it is or how to release it.  Help please.
0
 

Accepted Solution

by:
Skip_Laughlin earned 0 total points
ID: 40389968
Problem resolved.  It was a timing issue.  The step before the code above created the file in question with Crystal Reports running a PDF printer.  I put a 5 second delay in after the Action statement and before the copy statement, which gives it time to finish creating the PDF file.  World is much brighter this morning.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

809 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