Results 1 to 15 of 15

Thread: I'm having trouble connecting a VB app on one computer to a MySQL database on another

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Question I'm having trouble connecting a VB app on one computer to a MySQL database on another

    I've created a contact manager application in Visual Basic and I want to save the contact records to a MySQL database on another computer on the same network. Would anyone be able to provide some insight into this? I have installed MySQL Workbench along with the appropriate connectors and the .NET framework on both computers.

  2. #2
    Frenzied Member
    Join Date
    May 2013
    Posts
    1,126

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    What connection driver are you using?
    Is your connection driver installed?
    Are you using IP address or hostname on your connection?
    Have you check your connectionstring if correct?

    Or maybe your connection object is setup but no recordset?
    Or a firewall on the server is not permitting connection?
    Last edited by codesearcher; Aug 6th, 2014 at 07:16 PM.

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Quote Originally Posted by albra View Post
    I've created a contact manager application in Visual Basic and I want to save the contact records to a MySQL database on another computer on the same network. Would anyone be able to provide some insight into this? I have installed MySQL Workbench along with the appropriate connectors and the .NET framework on both computers.
    Have you previously tested the application on the local machine?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Yes, I've tested the application locally on a machine with MySQL and it worked perfectly: a connection was established and the contact records were saved to the database.

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Have a look at this thread if it helps

    http://www.vbforums.com/showthread.p...ork&highlight=
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    I have looked at the thread and I have applied some of the suggestions but I still can't get it to work. As I said above, the program connects with the database, as long as the database is on the same computer. However, when I try to connect to the database from a different machine in the same network, I am presented with an error saying "Unable to connect to any of the specified MySQL hosts."

  7. #7
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    1) What is the connection string you're using?
    2) actually, before I go on with 2 & possible 3, I need to know #1 first.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    MySQLConnection.ConnectionString =
    "server=localhost;port=3306;userid=root;password=password;database=contacts"

  9. #9
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Can you even access that computer where mysql is installed? Can you open its shared folders? Are they on the same workgroup? Are they on the same IP class?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  10. #10

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    The computers are not in a workgroup or anything similar to that at the moment, so I can't access shared folders but they are in the same IP class.

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    They should be in the same workgroup or domain and you must be able to access its Shared folders, at least that's what I also did in addition to adding per host wanting to connect to that computer which has mysql installed.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    I have now created a workgroup between the machines. I posted my connection string earlier, you'll notice the server is "localhost" I know that this won't work for a different computer trying to connect to the database, what should I use instead?

  13. #13
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    The name of the computer where mysql is installed.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  14. #14
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Quote Originally Posted by albra View Post
    MySQLConnection.ConnectionString =
    "server=localhost;port=3306;userid=root;password=password;database=contacts"
    Well that's why... you're accessing localhost... which is the same computer you're running on (everuy computer is "localhost") ... you need to give it either the IP or computer name..

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  15. #15

    Thread Starter
    New Member
    Join Date
    Apr 2014
    Posts
    13

    Re: I'm having trouble connecting a VB app on one computer to a MySQL database on ano

    Thanks for the explanation, I changed it to the computer name and now it works.

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