Part 1 - VB5 or 6 to MySQL
Using ODBC 3.51 connector
Set DB = New ADODB.Connection
Set RS = New ADODB.Recordset
DB.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=" & sHostName & ";" & _
"DATABASE=" & sDBName & ";" & _
"UID=" & sUID & ";PWD=" & sPWD & "; OPTION=3"
DB.Open
Set RS = DB.Execute("SHOW TABLES", ret)
Set cTable = New Collection
While RS.EOF = False
'get the data from the database columns
'(not fields because "real" databases have
'columns of data, not fields of entries) :) according to some professor in SQL
'-- not applicable code here
'-- vTable = RS.Fields(0)
'-- cTable.Add vTable
'-- not applicable code here
RS.MoveNext
Wend
DoEvents
'// do your stuff here...
Set RS = Nothing
DB.Close
'// as usual...
!!!REPLACE THE "SHOW TABLES" WITH YOUR OWN SQL QUERY!!!
Part 2- TreeView
See helpfile in VB for info on...
"Add Method (Nodes Collection)"
It has the example at the end of the listing.
Dim nodX As Node ' Declare the object variable.
Dim I as Integer ' Declare a counter variable.
For I = 1 to 4
Set nodX = TreeView1.Nodes.Add(,,,"Node " & Cstr(i))
' Use the reference to set other properties, such as Enabled.
nodX.Enabled = True
' Set image property to image 3 in an associated ImageList.
nodX.ExpandedImage = 3
Next I