the programe is about i have one folder named newdata which contain 46 folders and each folder containg multiple mdb files and with in mdb files there are two tables.
i want to merge all these folders data into one mdb file
my code is
Set dbparent = Workspaces(0).O penDatabase(txt parentMDBFile)
sDirFolder = Dir(txtchildMDB File.Text & "\", vbDirectory)
Do While sDirFolder <> ""
ReDim Preserve sArrayFolder(ic ount) As String
sArrayFolder(ic ount) = sDirFolder
icount = icount + 1
lblcount = icount
sDirFolder = Dir()
Loop
For icount = 2 To UBound(sArrayFo lder())
sDirFolder = Dir(txtchildMDB File.Text & "\" & sArrayFolder(ic ount) & "\*.mdb")
Do While sDirFolder <> ""
Set dbparent = Workspaces(0).O penDatabase(sDi rFolder)
squery = " insert inoto " & txtparenttable & " IN '" & txtparentMDBFil e & " ' select * from " & txtchildMDBFile & "\" & sDirFolder & " "
dbparent.Execut e (squery)
Loop
MsgBox "movenext"
Next
" the error is on do while loop i,e
do while sdirfolder<> ""
............... .............
............... ....
loop
and errro is couldnot open the .mdb file please help me
i want to merge all these folders data into one mdb file
my code is
Set dbparent = Workspaces(0).O penDatabase(txt parentMDBFile)
sDirFolder = Dir(txtchildMDB File.Text & "\", vbDirectory)
Do While sDirFolder <> ""
ReDim Preserve sArrayFolder(ic ount) As String
sArrayFolder(ic ount) = sDirFolder
icount = icount + 1
lblcount = icount
sDirFolder = Dir()
Loop
For icount = 2 To UBound(sArrayFo lder())
sDirFolder = Dir(txtchildMDB File.Text & "\" & sArrayFolder(ic ount) & "\*.mdb")
Do While sDirFolder <> ""
Set dbparent = Workspaces(0).O penDatabase(sDi rFolder)
squery = " insert inoto " & txtparenttable & " IN '" & txtparentMDBFil e & " ' select * from " & txtchildMDBFile & "\" & sDirFolder & " "
dbparent.Execut e (squery)
Loop
MsgBox "movenext"
Next
" the error is on do while loop i,e
do while sdirfolder<> ""
............... .............
............... ....
loop
and errro is couldnot open the .mdb file please help me
Comment