₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,228 members, 8,420,889 topics. Date: Friday, 05 June 2026 at 01:35 PM

Toggle theme

Need To Get This Vb6 Code Working, Pls Help! - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed To Get This Vb6 Code Working, Pls Help! (1177 Views)

1 Reply (Go Down)

Need To Get This Vb6 Code Working, Pls Help! by skoten(op): 5:42pm On Apr 11, 2011
Hello,

Want to know how to embedded access database into my application.The user require to enter default password then later change it when he/she gain access into the application or is there any other way i can do it

Please someone should help me

this is the code


Private Sub butOK_Click(Index As Integer)
Dim Password As String
If txtPassword.Text = "" Then
MsgBox "Invalid Password,try again!", vbOKCancel + vbCritical, "Login Error"
Else
If txtPassword.Text <> 1234 Then
MsgBox "Incorrect Password", vbCritical, "Login Error"
Else
If txtPassword.Text = 1234 Or FrmLogin.txtPassword = FrmChangePassword.txtReconfirm Then
Me.Hide
FrmMenu.Show
End If
End If
End If
End Sub
Re: Need To Get This Vb6 Code Working, Pls Help! by dellnet: 6:07pm On Apr 11, 2011
This is just to change access password.

Sub ChangeDBPassword ()
Dim Db As Database

Set Db = OpenDatabase("C:\MyDB.mdb",True, _
False,";pwd=1234"wink
Db.NewPassword "1234","newpassword"
Db.Close
MsgBox "Password Changed", vbok, "Password"
End Sub

Refrence Microsoft DAO Object Library for the code above to work.
Re: Need To Get This Vb6 Code Working, Pls Help! by skoten(op): 12:18pm On Apr 13, 2011
thanks dell_net,i will try your code and get back to you
Re: Need To Get This Vb6 Code Working, Pls Help! by findam: 12:31am On Apr 14, 2011
to login try,

Private Sub butOk_Click()
if txtpassword.text <> "" then
if txtpassword.text = 1234 then
FrmMenu.show
Me.hide
else
MsgBox "Invalid password", vbCritical , "Error"
me.txtpassword.setfocus
end if
else
msgbox "Invalid Username", vbCritical , "Error"
me.txtUsername.setfocus
end if
End Sub
Re: Need To Get This Vb6 Code Working, Pls Help! by skoten(op): 5:53pm On Apr 14, 2011
thanks findam,i also need it to connect to database.
Re: Need To Get This Vb6 Code Working, Pls Help! by Bossman(m): 7:22pm On Apr 15, 2011
If you need help with that, google for "connecting to MS Access from visual basic". This is is a common functionality back in the days, so you will get plenty of hits.

skoten:
thanks findam,i also need it to connect to database.
1 Reply

Login Code In Vb6.0Install Vb6 Application On AndroidHelp me convert this Vb6.0 code To Vb.net234

How Can I Add A Time Stamp To My GuiDifference Btw Software Development Approach And SW Devt MethodologyJava Programming Advice Needed