A
Alice
I have the following codes in VB which I need to convert to VB .NET 03.
It is the code for a command button click event in a form named frmLogin.
I have created a OleDbConnection Control, a OleDbDataAdapter Control and a
DataSet Control in my frmLogin(.net 03 version) to access another table
visually.
Do I need to create a new data connnection, data adapter, command object and
data set in codes in order to do what is done below or can I re-use the
controls somehow?
Can anybody help to convert the following codes to VB .Net 03? Thanks.
Private Sub cmdLogin_Click()
Dim UserMasterTb As Recordset
Set UserMasterTb = SYS_DB.OpenRecordset("User_Master", dbOpenTable)
With UserMasterTb
.Index = "PrimaryKey"
.Seek "=", Trim$(UCase(txtUserID.Text))
If Not .NoMatch Then 'userid found in database.
If Trim$(txtPassWd.Text) = Decrypt(![Usr_PassWd]) Then 'Password
correct.
CurrUserID_ = ![Usr_ID]
CurrUserLevel_ = ![Usr_Lvl]
End If
End If
End With
UserMasterTb.Close
Set UserMasterTb = Nothing
End Sub
It is the code for a command button click event in a form named frmLogin.
I have created a OleDbConnection Control, a OleDbDataAdapter Control and a
DataSet Control in my frmLogin(.net 03 version) to access another table
visually.
Do I need to create a new data connnection, data adapter, command object and
data set in codes in order to do what is done below or can I re-use the
controls somehow?
Can anybody help to convert the following codes to VB .Net 03? Thanks.
Private Sub cmdLogin_Click()
Dim UserMasterTb As Recordset
Set UserMasterTb = SYS_DB.OpenRecordset("User_Master", dbOpenTable)
With UserMasterTb
.Index = "PrimaryKey"
.Seek "=", Trim$(UCase(txtUserID.Text))
If Not .NoMatch Then 'userid found in database.
If Trim$(txtPassWd.Text) = Decrypt(![Usr_PassWd]) Then 'Password
correct.
CurrUserID_ = ![Usr_ID]
CurrUserLevel_ = ![Usr_Lvl]
End If
End If
End With
UserMasterTb.Close
Set UserMasterTb = Nothing
End Sub