Page 1 of 2 12 LastLast
Results 1 to 40 of 46

Thread: Connect to MYSQL with vb6

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Connect to MYSQL with vb6

    Is it possiblie connect to MYSQL with vb6 with adodc or adodb

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Yep.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    No.








    well actually yes, the "ADO connection" link below should help

  4. #4

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    could i get an exemple please?


  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  6. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    gonna check...thanks for the tip

  7. #7

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    hummm...didn't solve the problem...it got many exemples but any
    for the one i need...

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    And you need... what?

    Elaborate... will you use ADO or an ADO Data control?

  9. #9
    Lively Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    90
    There is a MySQL server you can connect to using ADO at this site:

    http://www.adoanywhere.com

    You need to register for the forum then get the database server details. I'll keep my eyses open for you.

    Mike (adoanywhere).

  10. #10

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972
    thanks for the help again...gonna check that

    i need to connect to a mysql server to qwery a database and get the results then.

    I don't have to use adodc or adodb, it was an idea...
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  11. #11
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    I created a form to connect to MySQL using ADODC and this is the error message:

    Connection failed:
    SQLState: '01000'
    SQL Server Error: 11004
    [Microsoft][ODBC SQL Server Driver ][TCP/IP Sockets]ConnectionOpen(Connect()).
    Connection failed:
    SQLState: '08001'
    SQL Server Error: 6
    [Microsoft][ODBC SQL Server Driver ][TCP/IP Sockets]Specified SQL Server not found.

    However, I used the server IP address and its port.

    Why do I get this error?
    Please advise.

    Note: I want to be able to connect to a database, and populate the datagrid. I know how to do that but it seems either my settings are wrong, or the server admin is not letting me gain access.

  12. #12
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    TDQWERTY,

    Look here under the section of Multi Database Control and you will find a working example of code that will connect to a mySQL databse as well as others. If this cannot connect then you are having admin problems.

  13. #13
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    TDQWERTY,

    Look here under the section of Multi Database Control and you will find a working example of code that will connect to a mySQL databse as well as others. If this cannot connect then you are having admin problems.

    3706 - Provider cannot be found. It may not be properly installed.

    I used the IP address of the server, and the username/password that was specified to login.

  14. #14
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    BrailleSchool,

    mySQL does need to have it's client / driver installed. Do you have this installed?

  15. #15
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    mySQL does need to have it's client / driver installed. Do you have this installed?
    I have no idea. I am very new to ADODC connections.

  16. #16
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    BrailleSchool,

    Look here for more info.

    MySQL Connector drivers

    MySQL provides a wide range of drivers allowing developers to integrate and customize database applications using their corporate tools of choice. The range of connectors makes it easy to incorporate MySQL into existing applications including:

    MySQL Connector/J for the Java platform
    MySQL Connector/ODBC for the ODBC application programming interface
    MySQL Connector/Net for the .NET platform

  17. #17
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    Look here for more info.

    MySQL Connector drivers

    MySQL provides a wide range of drivers allowing developers to integrate and customize database applications using their corporate tools of choice. The range of connectors makes it easy to incorporate MySQL into existing applications including:

    MySQL Connector/J for the Java platform
    MySQL Connector/ODBC for the ODBC application programming interface
    MySQL Connector/Net for the .NET platform

    I am going to download the MySQL Connector for ODBC, once I have downloaded it, do I install it on my computer?

  18. #18
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    BrailleSchool,

    Yes, you need to install it. There is an OLEDB driver for mySQL also. Look here for it

  19. #19
    Junior Member
    Join Date
    Feb 2005
    Posts
    22

    Re: Connect to MYSQL with vb6

    I think, U must create a ODBC (if u use OS : windows) to connect mySQL database

  20. #20
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    Yes, you need to install it. There is an OLEDB driver for mySQL also. Look here for it
    I installed the first one, downloading and will install the second. Then I should create a test form and an ODBC connection to test right?

  21. #21
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    BrailleSchool,

    ODBC or OLEDB connections can be made depending on which driver you will use.

  22. #22
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    ODBC or OLEDB connections can be made depending on which driver you will use.
    Ok. I am used to ODBC so should try that. If it does not work, I will surely return with error messages/problems.

    I would love to create an app to access mysql (delete/view/update/insert etc) that shouldnt be too difficult but need to get the connection to work first hehe.

    If neither of these work, would you think that the admin has blocked incoming requests using OLEDB/ODBC?

  23. #23
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    BrailleSchool,

    I am not sure, but check to see if you ave the correct port and ip address for mySQL server. The admin might have changed it for security reasons.

  24. #24
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    I am not sure, but check to see if you ave the correct port and ip address for mySQL server. The admin might have changed it for security reasons.

    If I telnet into my server, I use the domain name. If I FTP, I use the domain name or IP address.

    If I go into PHPMyAdmin, I go through port 2082. so do you think that would be the port?

  25. #25
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Connect to MYSQL with vb6

    Quote Originally Posted by randem
    BrailleSchool,

    I am not sure, but check to see if you ave the correct port and ip address for mySQL server. The admin might have changed it for security reasons.

    OK. I did the good stuff, I was told the connection was successful. Now I am working on the record view.
    Last edited by BrailleSchool; Apr 8th, 2005 at 03:47 PM.

  26. #26
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    I think OLEDB connection for MySQL is only working for VB.Net cause I tried with VB6 and it always open a dialog when I come to the .Open fonction.

  27. #27
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    You are incorrect. OLEDB for mySQL does work in VB6. You have to install the coorrect drivers.

  28. #28
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    Can you write down a URL where I can download the right version then?

  29. #29
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    That is also in this same thread. What version are you using?

  30. #30
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    I'm using MyOLEDB v.3.0

  31. #31
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    Look here for code examples on connecting (Multi Database Control). What error are you getting?

  32. #32
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    Can't I do it with MyOLEDB ?? I told you that OLEDB wasn't working with VB6 and you're asking me to download another program than MyOLEDB!!! Can't you just help me with MyOLEDB ?

  33. #33
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    BTW, it's the same thing to connect with either. What is your connection string?

  34. #34
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    Here is my connectionString

    "Provider=MySQLProv;Data Source=Data;User Id=root;Password=grb"

  35. #35
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    Your connection string is ok (if your database name is Data). What I was giving you to download was not another driver it was working code that uses MyOLEDB to connect. This would see if the issue that you are having was your driver and/or database installation.

    If the code downloaded worked then it would be something you are doing incorrectly in your code. Post more of your code for the open. Also tell me what error you get.
    Last edited by randem; Apr 12th, 2005 at 02:10 PM.

  36. #36
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    When I execute the open statement of my ADODB.connection. It always open the "MySQL Data Source Name Setup" dialog (Start -> Programs -> MyOLEDB -> Sample Database Creator)

    It looks like there's missing parameters to my connectionString, so I filled in the dialog everything I need and it says "Error occured" !

  37. #37
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    Well, we still will need to look at your code and possible try a program that is known to work to see what the problem could be.

  38. #38
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    VB Code:
    1. Dim connMySQL As ADODB.Connection
    2.  
    3. Set connMySQL = New ADODB.Connection
    4.  
    5. Call connMySQL.Open("Provider=MySQLProv;Data Source=Data;User Id=root;Password=grb")
    6.  
    7. ...

    The rest of the code is no need cause the problem is on the connection.

  39. #39
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Connect to MYSQL with vb6

    Gensor,

    Try

    ConnStr = "Provider=MySQLProv; Location=; Data Source=Data; UID=root; Password=grb"

  40. #40
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Connect to MYSQL with vb6

    No, it still open the "MySQL Data Source Name Setup" dialog.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width