Private Sub cmdMegnyitás_Click()
Dim dbs As Database, tdf As TableDef

'Ismételt nyitások miatt
Combo1.Clear
txtAdatb = ""
CommonDialog1.FileName = ""
DataGrid1.Enabled = False

'Adatbázis nyitás
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
    txtAdatb = CommonDialog1.FileName
    Set dbs = OpenDatabase(txtAdatb)
    For Each tdf In dbs.TableDefs
        If tdf.Attributes = 0 Then
            Combo1.AddItem tdf.Name
        End If
    Next

    dbs.Close
    Combo1.ListIndex = 0
    DataGrid1.Enabled = True
    grdRefresh

End If
End Sub

Public Sub grdRefresh()

Adodc1.RecordSource = Combo1.Text
Adodc1.CommandType = adCmdTable
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                          "Data Source=" & txtAdatb & ";" & _
                          "Mode=ReadWrite;" & _
                          "Persist Security Info=False"
Adodc1.Refresh

End Sub

Private Sub Combo1_Click()
grdRefresh
End Sub
