ranjit
July 14th, 1999, 10:50 AM
I have written a program to split a mdb file in 1 mb chunks are rejoin them for distribution purpose but am having problems in rejoing them as some of the tables refuse to open but remaining open on prob , ie out of 18 table only 4 refuse to open could some one help me out please Source included
const chunksize as integer = 1024000
Private Sub Command1_Click()
Cd1.Filter = "(*.mdb)|*.mdb"
Cd1.Action = 1
fname = Cd1.filename
fnum = FreeFile
fnum1 = fnum + 1
part = 0
dest = "split"
act = dest & part
Open fname For Binary Access Read As #fnum
Open act For Binary Access Write As #fnum1
len1 = LOF(fnum)
chunks = len1 / chunksize
frac = len1 Mod chunksize
ReDim by1(frac)
Get #fnum, , by1()
Put #fnum1, , by1()
Close #fnum1
For i = 1 To ((len1 - frac) / chunksize)
part = part + 1
act = dest & part
Open act For Binary Access Write As #fnum1
ReDim by1(chunksize)
Get #fnum, , by1()
Put #fnum1, , by1()
Close #fnum1
Next i
End Sub
Private Sub Command2_Click()
Cd1.Action = 1
fname = Cd1.filename
fnum = FreeFile
fnum1 = fnum + 1
Open fname For Binary Access Write As #fnum
Do While True
Cd1.Action = 1
fname1 = Cd1.filename
If Not fname1 Like "*sp*" Then Close #fnum: End
Open fname1 For Binary Access Read As #fnum1
ReDim by1(LOF(fnum1))
Get #fnum1, , by1()
Put #fnum, , by1()
Close #fnum1
Loop
End Sub
as u can see it is a trial prog not the complete thing if it works i can refine my project a bit more but this is the one on which i am working and its working 3/4 th way help me make it work completly
const chunksize as integer = 1024000
Private Sub Command1_Click()
Cd1.Filter = "(*.mdb)|*.mdb"
Cd1.Action = 1
fname = Cd1.filename
fnum = FreeFile
fnum1 = fnum + 1
part = 0
dest = "split"
act = dest & part
Open fname For Binary Access Read As #fnum
Open act For Binary Access Write As #fnum1
len1 = LOF(fnum)
chunks = len1 / chunksize
frac = len1 Mod chunksize
ReDim by1(frac)
Get #fnum, , by1()
Put #fnum1, , by1()
Close #fnum1
For i = 1 To ((len1 - frac) / chunksize)
part = part + 1
act = dest & part
Open act For Binary Access Write As #fnum1
ReDim by1(chunksize)
Get #fnum, , by1()
Put #fnum1, , by1()
Close #fnum1
Next i
End Sub
Private Sub Command2_Click()
Cd1.Action = 1
fname = Cd1.filename
fnum = FreeFile
fnum1 = fnum + 1
Open fname For Binary Access Write As #fnum
Do While True
Cd1.Action = 1
fname1 = Cd1.filename
If Not fname1 Like "*sp*" Then Close #fnum: End
Open fname1 For Binary Access Read As #fnum1
ReDim by1(LOF(fnum1))
Get #fnum1, , by1()
Put #fnum, , by1()
Close #fnum1
Loop
End Sub
as u can see it is a trial prog not the complete thing if it works i can refine my project a bit more but this is the one on which i am working and its working 3/4 th way help me make it work completly