Jump to content

Connect vb.NET application with a MySQL Database

Recommended Posts

Hi guys,I want to create a vb.net application with a login.I want that the login verify the username and password with a table witch contains all usernames and passwords of all members and if the login found a correspondence with the table, I want that the login connect the user at the application.In the next form, I want that the application show some 'informations' like Name, E-mail, ... for the user that is logged in.I have try a lot of code, but none was working correctly.What can I do for make this 'simple' application? Best regards,Francesco

Link to post
Share on other sites
  • 3 weeks later...
    'Practicum 2    Public cnnMySQL As New ADODB.Connection    Public RS As New ADODB.Recordset    Public MysqlCharset As String = "UTF8"    Public Sub ConnectMy(ByVal dbName As String, ByVal DbUser As String, ByVal DbPass As String)	    On Error GoTo ado2	    Dim MySqlHost As String = ""	    'MySqlHost = "localhost"	    cnnMySQL.CursorLocation = ADODB.CursorLocationEnum.adUseClient	    cnnMySQL.Open("Driver={MySQL ODBC 5.1 Driver};Server=" & MySqlHost & ";Database=" & dbName & "; User=" & DbUser & ";Password='" & DbPass & "';Option=3;")	    Exit Subado2:	    MsgBox("Error Please Check !?!" & MySqlHost & " * " & Err.Description, vbOKOnly)	    'MsgBox()	    End    End Sub-----------------------------------...Onload...ConnectMy("dbName", "DbUser", "dbPassword")

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...