Connecting from vb 2008 express to mysql database.

Connecting from vb 2008 express to mysql database on a free webhost.

Page 1 of 1

2 Replies - 11751 Views - Last Post: 23 July 2009 - 08:09 AM Rate Topic: -----

#1 bammo10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 23-July 09

Connecting from vb 2008 express to mysql database.

Posted 23 July 2009 - 06:02 AM

Hello everybody,

I have created a simple application with VB 2008 Express edition.
I have a little bit of experience with mysql, but I have no idea on how to connect to
a database on a webhost server.
I don't have any idea on how to start, so if you guys can just point me in the right direction, or
give my some commands I can use, that would be awesome.

The idea is as following.

I have a table called "NP"
My application must first check if a number exists in the row "number".
If the number exists, and the cell in the row next to it (called "Points"), it must
write variable "Points" in the row "Points".
Like this:

Number..........Points
-------------+--------------
.......1........|......500.....
-------------+--------------
........2.......|......600.....
-------------+--------------

etc.


But if the number doesn't exist in the row numbers.
It must do this.
Msgbox("Your number does not exist.")

And if the cell points isn't empty, it must check if the value "points" from
the cell = the variable "points" which = textbox1.text, if they are the same:
form3.show()

If they don't match:
msgbox("Your number and points don't match")

But if the cell "Points" is empty:
form3.show()


Please, I know you will not do my homework (though it isn't :P )
but please be detailled.

Greets Chris from The Netherlands

This post has been edited by bammo10: 23 July 2009 - 06:09 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Connecting from vb 2008 express to mysql database.

#2 PDUNZ  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 43
  • View blog
  • Posts: 372
  • Joined: 17-July 09

Re: Connecting from vb 2008 express to mysql database.

Posted 23 July 2009 - 07:33 AM

And yes, because we're not going to do your homework Ill give you a starting point.

Have you searched the Tutorials section? Use VB.NET to connect to MySQL, Read that (its a start), try it, if it dosnt work - come back, post the code and we will be happy to help further.

Also - you will only be able to connect to a local MySQL server (on yours or network). To connect to an online server, the webhost needs to have "Remote Access" enabled - which is rarely enabled for security reasons.

This post has been edited by PDUNZ: 23 July 2009 - 07:38 AM

Was This Post Helpful? 0
  • +
  • -

#3 bammo10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 23-July 09

Re: Connecting from vb 2008 express to mysql database.

Posted 23 July 2009 - 08:09 AM

View PostPDUNZ, on 23 Jul, 2009 - 06:33 AM, said:

And yes, because we're not going to do your homework Ill give you a starting point.

Have you searched the Tutorials section? Use VB.NET to connect to MySQL, Read that (its a start), try it, if it dosnt work - come back, post the code and we will be happy to help further.

Also - you will only be able to connect to a local MySQL server (on yours or network). To connect to an online server, the webhost needs to have "Remote Access" enabled - which is rarely enabled for security reasons.


Thanks for the quick reply PDUNZ,

But I don't get the point of "on yours or your network." I know what you mean though but does that mean even if have portforwarded my sever IP and use an Apache/MySQL server like Wampserver on the server pc + a MySQL database with a program like Navicat?
Bcuz I have another program that I want to publish but I want it to be payed for and receive an activation key.
But if I dont let it check a database, people will be able to use 1 key infinite times! :blink:
And in a short amount of time there will be a keygen for my program.
If you have any solutions to my problem I will be very happy to hear.

Ps. Nice tuturial! But I really REALLY need to connect from PC's that are not in my LAN to the server pc. :rolleyes:.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1