Public Class Form1

    Private module1 As Module1 = Module1.GetInstance()

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click, Button3.Click
        ShowTableForm(CType(sender, Control).Text)
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        ShowTableForm(Button2.Text)
    End Sub

    Private Sub ShowTableForm(tableName As String)
        module1.DBread(tableName)
        module1.show_form2()
    End Sub

    Private Sub btnOpen_Click(sender As Object, e As EventArgs) Handles btnOpen.Click
        Dim ret = OpenFileDialog1.ShowDialog()
        If ret <> DialogResult.OK Then
            Exit Sub
        End If
        txtFileName.Text = OpenFileDialog1.FileName
    End Sub

    Private Sub txtFileName_TextChanged(sender As Object, e As EventArgs) Handles txtFileName.TextChanged
        Dim mdbFileInfo As New MDBFileInfo
        Dim filepath As String = txtFileName.Text
        mdbFileInfo.Prvd = "Microsoft.Jet.OLEDB.4.0" 'プロバイダ(mdb用)
        mdbFileInfo.fol_name = System.IO.Path.GetDirectoryName(filepath)
        mdbFileInfo.db_name = System.IO.Path.GetFileName(filepath)
        module1.mdbFileInfo = mdbFileInfo
    End Sub
End Class
