vishalsalunkhe1
New member
- Local time
- Yesterday, 19:35
- Joined
- Nov 20, 2013
- Messages
- 2
Hi,
I want to combine multiple access (*.mdb) files into one mdb file. All the files have same table and same fields. The structure of target database will also be exactly same as source files. I am actually trying to create an exe file in VB6 which will have browse option to select source mdb files and browse for target mdb location. and when I click on OK button , it should consolidate all the data from source files into target file. I am not a programmer still i am able to create a dialog box but I can't write a code to combine mdb files, Could you please help me to achieve my goal? I need to complete it by thursday anyhow so your earlist help is appreciated.
CODE -
'Declare a variable as a FileDialog object.
Dim fd As Office.FileDialog
Dim app
Dim OutFilename As String
Dim InFolder As String
Private Sub BrowseInput_Click()
Set fd = app.FileDialog(msoFileDialogFolderPicker)
With fd
'Use the Show method to display the File Picker dialog box and return the user's action.
'The user pressed the action button.
If .Show = -1 Then
InFolder = .SelectedItems(1)
InputPath.Text = InFolder
'The user pressed Cancel.
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Private Sub OkButton_Click()
'Write Conversion Code here
Dim strPattern As String
Dim strFile As String
Dim currFile As String
strPattern = InFolder & "\" & "*.mdb"
strFile = Dir(strPattern, vbNormal)
Do While Len(strFile) > 0
currFile = InFolder & "\" & strFile
Debug.Print strFile
strFile = Dir
Loop
End
End Sub
Private Sub BrowseOutput_Click()
'Create a FileDialog object as a File Picker dialog box.
Set fd = app.FileDialog(msoFileDialogSaveAs)
With fd
'Use the Show method to display the File Picker dialog box and return the user's action.
'The user pressed the action button.
If .Show = -1 Then
OutFilename = .SelectedItems(1)
OutputPath.Text = OutFilename
'The user pressed Cancel.
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Private Sub CancelButton_Click()
End
End Sub
Private Sub Form_Load()
' Default property is assigned to Type 8 Variant RetVal.
Set app = CreateObject("Access.Application")
app.Visible = False
End Sub
:banghead:
:banghead:
I want to combine multiple access (*.mdb) files into one mdb file. All the files have same table and same fields. The structure of target database will also be exactly same as source files. I am actually trying to create an exe file in VB6 which will have browse option to select source mdb files and browse for target mdb location. and when I click on OK button , it should consolidate all the data from source files into target file. I am not a programmer still i am able to create a dialog box but I can't write a code to combine mdb files, Could you please help me to achieve my goal? I need to complete it by thursday anyhow so your earlist help is appreciated.
CODE -
'Declare a variable as a FileDialog object.
Dim fd As Office.FileDialog
Dim app
Dim OutFilename As String
Dim InFolder As String
Private Sub BrowseInput_Click()
Set fd = app.FileDialog(msoFileDialogFolderPicker)
With fd
'Use the Show method to display the File Picker dialog box and return the user's action.
'The user pressed the action button.
If .Show = -1 Then
InFolder = .SelectedItems(1)
InputPath.Text = InFolder
'The user pressed Cancel.
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Private Sub OkButton_Click()
'Write Conversion Code here
Dim strPattern As String
Dim strFile As String
Dim currFile As String
strPattern = InFolder & "\" & "*.mdb"
strFile = Dir(strPattern, vbNormal)
Do While Len(strFile) > 0
currFile = InFolder & "\" & strFile
Debug.Print strFile
strFile = Dir
Loop
End
End Sub
Private Sub BrowseOutput_Click()
'Create a FileDialog object as a File Picker dialog box.
Set fd = app.FileDialog(msoFileDialogSaveAs)
With fd
'Use the Show method to display the File Picker dialog box and return the user's action.
'The user pressed the action button.
If .Show = -1 Then
OutFilename = .SelectedItems(1)
OutputPath.Text = OutFilename
'The user pressed Cancel.
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Private Sub CancelButton_Click()
End
End Sub
Private Sub Form_Load()
' Default property is assigned to Type 8 Variant RetVal.
Set app = CreateObject("Access.Application")
app.Visible = False
End Sub
:banghead:
:banghead: