Hello there,
I'm creating a program that will connect to a MySQL server online. So, when I try to load the program, it really takes time before all the data will be displayed, in short, it will take few seconds or maybe minutes before the form could be seen. That's why I'm trying to add a progress bar to show progress.
Here is my code for the main form, the one that will connect to the server.
CODE
Dim CNN As Connection
Dim rs As Recordset
' Creating a connection and defining variables.
Set CNN = New Connection
CNN.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=" & server & ";" _
& "DATABASE=" & database & ";" _
& "PORT=" & port & ";" _
& "UID=" & user & ";PWD=" & password & ";OPTION=3"
CNN.Open
' Connect to the database using this SQL.
sql = "SELECT * FROM user"
Set rs = New Recordset
rs.Open sql, CNN
' Display all the records.
While (Not rs.EOF)
List1.AddItem rs.Fields(3) & " " & rs.Fields(4)
rs.MoveNext
Wend
Set rs = Nothing
CNN.Close
I would like to have another form or maybe a MDI form to display the progress bar.
Hope you can understand.
Thanks.