MySQL Forums :: Visual Basic :: connecting vb2005 login system to sql database on remote server


Advanced Search

connecting vb2005 login system to sql database on remote server
Posted by: omar yusuf ()
Date: March 03, 2008 05:04AM

Hi I'm a newbie to vb.net as well as sql. I'm currrently working on a vb login system. The problem I'm facing is I keep on getting an "Error Connecting to Database : Access denied for user'user@localhost'(using password:Yes)" message.
I have downloaded the MySQL suite with MYSQL connector Net.
the code is shown below:

Imports MySql.Data.MySqlClient
Public Class frmLogin
Dim conn As MySqlConnection
Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
Application.Exit()
End Sub
Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
conn = New MySqlConnection()
conn.ConnectionString = "server=" & ";" _
& "username=" & txtuser.Text & ";" _
& "password=" & txtpass.Text & ";" _
& "database=vbchat"
Try
conn.Open()
MessageBox.Show("Connection Opened Successfully")
frmChat.Show()
conn.Close()
Me.Close()
Catch MyError As MySqlException
MessageBox.Show("Error Connecting to Database: " & MyError.Message)
Finally
conn.Dispose()
End Try
End Sub
End Class

Please assist me with info on how to connect to the database (vbchat), to query the information from specific tables & columns.
All the help is greatly appreciated
thanx



Edited 1 time(s). Last edit at 03/03/2008 05:48AM by omar yusuf.

Options: ReplyQuote


Subject Written By Posted
connecting vb2005 login system to sql database on remote server omar yusuf 03/03/2008 05:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.