Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Convert VB6/Access to VB6/Mysql Posted by samuelmoneill on 8 Jun 2009 at 4:48 AM
Hi,

I am new to VB. I have experience in connecting mysql to PHP.

I have been asked to change an existing application written in VB6(connected to Access databases) to VB6(Connected to mysql database).

Can anyone tell me how to connect VB6 to mysql? Add as much detail as possible.

This is a snippet of the current code I have for VB6(Access).

Private Sub Command1_Click()
    full_log_form.List1.Clear
    full_log_form.Visible = True
    main.Visible = False
    
    rs.Open ("SELECT * FROM [table1]"), DataEnvironment1.Connection1, adOpenStatic, adLockOptimistic  'open table1 in connection2
        If Not rs.BOF Then
            rs.MoveFirst
        End If
        Do Until rs.EOF
            temp_string = rs.Fields("Client").Value
            list_string = rs.Fields("Client").Value
            For i = 0 To (30 - Len(temp_string))
                list_string = list_string & " "
            Next i
            list_string = list_string & rs.Fields("Serial") & vbTab & rs.Fields("Alarm") & vbTab & rs.Fields("DateRec") & vbTab & rs.Fields("Time")
            full_log_form.List1.AddItem list_string
            
            'full_log_form.List1.AddItem rs.Fields("client") & vbTab & rs.Fields("Serial") & vbTab & rs.Fields("Alarm") & vbTab & rs.Fields("DateRec") & "   " & rs.Fields("Time")
            rs.MoveNext
        Loop
    rs.Close
End Sub


Any help would be grately appreciated.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.