Lorddrago
10-18-2004, 12:43 AM
I am working on a program in VB6 that connects to a remote mysql at my hosting company.
I have the connection working and am reading in files but it takes forever. I am reading in 1 record set with 9 fields. As a test I only have 1's and 0's in each field. It takes around 20 sec. to fill in the 9 text boxes. Each either haveing a 1 or 0 in it. Any sudjestions on how to speed this up. I am running on a cable modem so hate to see what this would be like on a 56k. This is my connection code below.
If Not Connect(c1) Then
MsgBox "Connection Failed"
Else
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM check1", Conn, adOpenStatic, adLockOptimistic
End If
c7 = rs.Fields("c7").Value
c8 = rs.Fields("c8").Value
c9 = rs.Fields("c9").Value
c10 = rs.Fields("c10").Value
c11 = rs.Fields("c11").Value
c12 = rs.Fields("c12").Value
rs.Close: Set rs = Nothing
and this is the module it calls for the connection
Option Explicit
Public Conn As ADODB.connection
Public Function Connect(cox As String) As Boolean
On Error GoTo ErrorTrap
Connect = False
Set Conn = New ADODB.connection
Conn.CursorLocation = adUseClient
Conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=xxx.xx.xxx.xx;" _
& "DATABASE=com_xxxxxxx;" _
& "UID=com_xxxxxx;" _
& "PWD=xxxxxx;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
Debug.Print Conn.ConnectionString
Conn.Open
Connect = True
ExitPoint:
Exit Function
ErrorTrap:
Connect = False
MsgBox "You must be Connected to the internet before running Club Click"
Resume ExitPoint
End Function
I have the connection working and am reading in files but it takes forever. I am reading in 1 record set with 9 fields. As a test I only have 1's and 0's in each field. It takes around 20 sec. to fill in the 9 text boxes. Each either haveing a 1 or 0 in it. Any sudjestions on how to speed this up. I am running on a cable modem so hate to see what this would be like on a 56k. This is my connection code below.
If Not Connect(c1) Then
MsgBox "Connection Failed"
Else
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM check1", Conn, adOpenStatic, adLockOptimistic
End If
c7 = rs.Fields("c7").Value
c8 = rs.Fields("c8").Value
c9 = rs.Fields("c9").Value
c10 = rs.Fields("c10").Value
c11 = rs.Fields("c11").Value
c12 = rs.Fields("c12").Value
rs.Close: Set rs = Nothing
and this is the module it calls for the connection
Option Explicit
Public Conn As ADODB.connection
Public Function Connect(cox As String) As Boolean
On Error GoTo ErrorTrap
Connect = False
Set Conn = New ADODB.connection
Conn.CursorLocation = adUseClient
Conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=xxx.xx.xxx.xx;" _
& "DATABASE=com_xxxxxxx;" _
& "UID=com_xxxxxx;" _
& "PWD=xxxxxx;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
Debug.Print Conn.ConnectionString
Conn.Open
Connect = True
ExitPoint:
Exit Function
ErrorTrap:
Connect = False
MsgBox "You must be Connected to the internet before running Club Click"
Resume ExitPoint
End Function