Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\..................mdb"
Conn = New OleDbConnection(ConnString)
Dim h As Integer
For h = 0 To GetTables(Conn).Rows.Count - 1
cmbtable.Items.Add(GetTables(Conn).Rows(h).Item(2))
Next
Public Function GetTables(ByVal conn As OleDbConnection) As DataTable
conn.Open()
Dim schemaTable As DataTable
schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
conn.Close()
Return schemaTable
End Function
Partager