Solved

Simple filecopy in VB6 fails

Posted on 2014-10-18
2
194 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordsWithout 49 80
sumDigits  challenge 7 62
wordmultiple challenge 12 92
how to update exe applicatio from internet ? 6 41
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now