views:

197

answers:

1

I am helping my son write a program to format files to load into another system. I have done this before with no trouble. Now I get a 13 KB comma delimited text file and I am copying it use FSO to another file with a csv extension. For some reason the new file always stops at the same place, about6 records from the end of the file original file. I thought it might be something with the record after the line where it stopped so I move the record in the file. No change stopped at the same place. So moved the records above where it stopped. Still the same problem. It stops at 13 KB and leaves off about6 records. The only thing I can think of is file size, but is is below the limit of the VB CopyFile. I have imported the original file into Excel no problem. I have done a rename of the file and opened it in Excel no problem. Please give me and idea of where to go next.

A: 

I've heard of this happening before with fso, but I haven't heard of a solution (or a cause, for that matter). If you're using vb.net, you can use the my.computer.filesystem.filecopy function instead of fso. If you're using vb6, you can also copy a file this way, although it's not very elegant.

Dim s As String

Open sourcename For Binary As 1
s = String(LOF(1), " ")
Get 1, , s
Close 1

Open destname For Binary As 1
put 1, , s
close 1
xpda