If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > VB to MySQL Login Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-27-04, 22:59
simkeechai simkeechai is offline
Registered User
 
Join Date: Aug 2004
Posts: 3
VB to MySQL Login Help

Hi all, i am a student. Currently working on a course project which i would like to have the login function. Could anyone of you here teach me or show me the sample code to VB on how to write a login code. The login will be connected to mysql database in user table, and how to encrypt the password. I have my sample code here, i will show you guys later.

Also, my question is how do i compare the userid and password that the user has input to the database to chech whether the user is existed in the database. And, how do i create a welcome message to tell the user if he/she has been login successfully. Thanks

below are my simple login code:

Private Sub cmdLogin_Click()
Dim cnMySql As New rdoConnection
Dim sConnect As String
Dim sADOConnect As String
Dim sDAOConnect As String


sConnect = sConnect & "UID=" & txtUserID.Text & ";"
sConnect = sConnect & "Password=" & txtPassword.Text & ";"

cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = sConnect & _
"driver={MySQL ODBC 3.51 Driver};database=bus;dsn='';"
cnMySql.EstablishConnection
'cnMySql.Connect

'Load



'If cnMySql.Connect Then
MsgBox "Conglatulation " & txtUserID.Text & ", connection established."
'End If
Load frmvb6Mysql


'sADOConnect = "PROVIDER=MSDASQL;" & sDSN & sConnect
'sDAOConnect = "ODBC;" & sDSN & sConnect
End Sub

any help will do a lot. thanks in advance
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On