Results 1 to 6 of 6

Thread: How to connect vb6-mysql

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2016
    Posts
    7

    How to connect vb6-mysql

    Hi!
    I am developing a blackjack game with login system.
    But I need to connect vb6 and mysql.
    I can do for the ADO, but how do I for my application be used on other computers that do not have MySQL ODBC 3.51 Driver? Is there another way?

    For example I have this code:

    Code:
    Set con = New ADODB.Connection
    
    con.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER= mysql.hostinger.pt;DATABASE=mydatabase;USER=my_user;PASSWORD=12345;OPTION=3;"
    con.CursorLocation = adUseClient
    
    con.Open
    If noted my mysql database is hosted on a web server, and is not localhost.

    And now I want my application to work on another computer, it is possible?

    Appreciate Answers!
    Thanks!

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2016
    Posts
    7

    Re: How to connect vb6-mysql

    Please I need Help!!!

  3. #3
    gibra
    Guest

    Re: How to connect vb6-mysql

    You must install the client MySQL ODBC 3.51 Driver in other computer, of course.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How to connect vb6-mysql

    if the vb6 program is on a local machine and the database is on a remote web server i do not believe that a normal connection from vb program would work, probably have to use some script on the server, like php, then access it using a webpage that the vb6 program can post data

    i have never done this so i am just guessing, you probably need to do more research on using mysql remotely
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    Junior Member
    Join Date
    Sep 2014
    Location
    Brisbane
    Posts
    19

    Re: How to connect vb6-mysql

    If you're talking to a remote PC i.e LINUX server, Google the mySQL Connector - mysql-connector-odbc. Make sure that Port 3306 is not firewalled on your local PC, or you won't be able to connect to the mySQL server.

    You will need the ODBC Connector to be installed on all PC's that run your program. Once again, Google the Connector and read the Help page for silent installations on target PC's.

    HTH's.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How to connect vb6-mysql

    The issue usually isn't local firewall rules, because in most cases outgoing connections aren't blocked for nearly any port.

    Firewall rules at the server are typically a far bigger issue. Remember, most web-hosting providers can't afford to allow direct database connections through their firewalls. Software like MySQL and other client/server DBMSs have far too many known and potential vulnerabilities.

    Even barring that, typical naive monolithic database coding tends to shovel vast amounts of data back and forth over the wire. While sometimes tolerable within a LAN, performance can be terrible across the Internet. Since the hosting provider has to pay for the bandwidth consumed that's another reason why they don't like to allow it.

    The "fix" is to break up the monolith by moving as much logic as possible onto the server near the database, then write a "web service" API for this logic. Your client programs can use that for access. This requires planning and application redesign so most people end up just giving up.


    However if your hosting provider is allowing this then yes, you have to ensure that the appropriate connector software is installed on client systems.

Tags for this Thread

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