Display username from MS access


hi , i need your help !!
plz reply my messages .
i m using vb 6.0 .
i want to display the username who have login from the
frmLogin into the frmLocation when i clicking the next or login button .
the username is get from access and when user login the page , the username from access are display in the label on the frmLocation .
plss helpppppp me!!!!

If you enjoyed this post, subscribe for updates (it's free)

Display username from MS access

***********code for frmLog_In

Private Sub CmdLogIN_click()
global con as new ADODB.Connection
dim rs as new ADODB.Recordset
rs.Open "select * from tbluser where uname='" & txtuname & "' and pw='" & txtpw & "' ",con,2,3
If rs.recordcount=0 then
Msgbox "Invalid User Name and password.",vbExclamation,"Invalid"
Else
With frmLocation
.lblUname.Caption= rs!uname
.lblpw.Caption= rs!pw
Unload Me
.Show 1
End With
End If
rs.Close
End Sub

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.