VB6 and MYSQL Connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pa2ratczi
    New Member
    • Mar 2007
    • 19

    VB6 and MYSQL Connection

    Hi there VB6 master i have a question, how can i access my mysql database in vb6... am not very familiar inmysql that's why i dont know how to start... i have using vb6 & access for all my programming work, but now i decided to shift to a higher level of programming, can you give some step by step procedure on how i can achieve to access my mysql database in vb6...

    I have successfully created a mysql database, and created table fields and insert some data's on it... but i dont know how to access the database...

    can somebody give some sample code on how to connect or access my mysql database or direct me on some website where i can read some points...

    by d way am using mysql server version 4.1...


    thank you so much ... sorry if i dont have sample codes for it, because i dont know how to start.. hoping that someone here can help me...
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by pa2ratczi
    Hi there VB6 master i have a question, how can i access my mysql database in vb6... am not very familiar inmysql that's why i dont know how to start... i have using vb6 & access for all my programming work, but now i decided to shift to a higher level of programming, can you give some step by step procedure on how i can achieve to access my mysql database in vb6...

    I have successfully created a mysql database, and created table fields and insert some data's on it... but i dont know how to access the database...

    can somebody give some sample code on how to connect or access my mysql database or direct me on some website where i can read some points...

    by d way am using mysql server version 4.1...


    thank you so much ... sorry if i dont have sample codes for it, because i dont know how to start.. hoping that someone here can help me...
    So how do you connect your access to vb6? make some changes there.

    Rey Sean

    Comment

    • pa2ratczi
      New Member
      • Mar 2007
      • 19

      #3
      hey! i've finally achieve what i want to do, i was able to connect my mysql database in my vb6 progam

      To share heres my code:

      Code:
        Set conn = New ADODB.Connection
        conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
                              & "SERVER=localhost;" _
                              & "PORT=3306;" _
                              & "DATABASE=user;" _
                              & "UID=;PWD=; OPTION=3;" _
                              & "STMT=;"
      
        conn.Open
        
        Set rs = New ADODB.Recordset
        rs.CursorLocation = adUseServer
      Now i have a different story, i have a mysql database running on a linux server... its an online registration, now what i have to do is to access my mysql database on my linux based server.. is it possible? hitch me some hints....

      Thanks

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        You need to specify the server name / ip address in the connection string.

        Comment

        • wireshark
          New Member
          • Mar 2008
          • 29

          #5
          Originally posted by debasisdas
          You need to specify the server name / ip address in the connection string.
          sorry,i really want to know,cause this discussion related what i do now.
          i was make my connection like this....
          [VB]
          Set conn = New ADODB.Connectio n
          conn.Connection String = "DRIVER={My SQL ODBC 3.51 Driver};" _
          & "SERVER=srv7.89 0m.com;PORT=330 6;DATABASE=data base;UID=a28400 13_guest;" _
          & "PWD=mypass ; OPTION=3;STMT=; "
          conn.Open
          Set rs = New ADODB.Recordset
          rs.CursorLocati on = adUseServer
          [VB]
          but i cant connect it...it say access denied for user a2840013_guest@ 222.194.99.242( using passoword:Yes)
          the 222.194.99.242 is my ip...... not the webserver...
          im sure that my password and user name is right....
          what i must to do?
          thank you.....

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            There is some access issue. You need to contact your sys admin and get the desired permission granted. You have to pass server username / password and database uername / password.

            Comment

            Working...