Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help w/ filecopy in vb6

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I have a database that is 486kb and need to filecopy that to a:\. As the database size increases I will need it to save onto several disks. How do I do that? Also I need to be able to bring that file(which would/could be on several disks) back to the c:\ at a later time. How do I also do this? I tried the following and it saved the current(486kb)database onto 6 disks, none of which I was able to open.

private sub Command1_click()
on error GoTo Error_Handler
filecopy"c:\windows\Desktop\MDS.mdb","A:\MDS.mdb"
exit sub

Error_Handler:
msgbox"Insert next disk"
resume
end sub
 
Asside from the obvious answer of using a bigger disk, LS120 or Zip100/250, you might consider using PKZip or WinZip. The command line pkzip program has an option for spanning multiple disks. From within Vb you could use the shell statement to use it.
 
Don't recall code, but old GWBASIC freeware or shareware called SPLIT.EXE [look for it & buy it, shell to it and use it as-is, or decompile to learn how to do it & write your own subroutine] could break a binary file into &quot;n&quot; pieces requested at runtime. With foreknowledge of your database file size, you could run a split-type subroutine that calc'd number of pieces to SPLIT it into, then copy the <1.44Mb pieces to &quot;n&quot; sequential floppies in a loop. Re-assembly required a concatenation of the pieces under, for example, the COPY command line:
>copy filename.001 /b + filename.002 /b + filename.003 /b [+ any other pieces /b] concatfilename.ext

I'd help more but I'm a newbie at VB too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top