473,811 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change password using access as database?

12 New Member
please can anyone help me?
im currently working in a project and i already made a code for the login, the only thing is that i dont know how to update the records(Usernam e/Password) in access using VB 2010. well i can update by manually changing the content of my table but i like to have it change using an interface in my vb named Manage account...

thank you in advance.
Feb 4 '11 #1
9 5382
timr30017
9 New Member
Hey!

I don't know if you mean you want to change the username/passwords that are or can be integrated with Access by enabling security or if you have a table that contains username and passwords.

If it is the later case then you should be able to do something like so by adding a DataBindingSour ce to your form you use to Manage account.

Expand|Select|Wrap|Line Numbers
  1.  Me.SettingsBindingSource.MoveFirst()
  2.                 Me.SettingsBindingSource.RemoveCurrent()
  3.                 Me.Validate()
  4.                 Me.SettingsBindingSource.EndEdit()
  5.                 Me.TableAdapterManager.UpdateAll(Me.RecruitingDataSet)
  6.                 Me.SettingsBindingSource.AddNew()
You will just need to modify this code a bit above to find the correct user then delete their username/password and add it back using the Addnew method.

Then be sure to do this:

Expand|Select|Wrap|Line Numbers
  1.  Me.Validate()
  2.                 Me.SettingsBindingSource.EndEdit()
  3.                 Me.TableAdapterManager.UpdateAll(Me.RecruitingDataSet)
  4.             Else
  5.                 MessageBox.Show("The passwords do not match - please try again.")
  6.             End If
Feb 4 '11 #2
dexter delleva
12 New Member
i do have a table that contains username and password. and there are 3 default username and password that can be use to login. if i were the Admin(one of the user) i can login using the default password for the username admin and at the same time to enforce security i can update or change may accounts password.

thanks for your reply. I'll try this.
Feb 4 '11 #3
dexter delleva
12 New Member
im confuse, how can i compare the if statement in the code directly to password only.
" if me.validate () = ? then
Me.SettingsBind ingSource.EndEd it() Me.TableAdapter Manager.UpdateA ll(Me.Recruitin gDataSet)"

is my logic right?? sorry for not understanding well, im not really good in coding^^
Feb 4 '11 #4
timr30017
9 New Member
No what you want to find and compare is the record you want to change so if say the user name is admin you will do something like the following. But the trick I used was to put a textbox field on the form. IF you don't want the user to see it so your app stays all 'pretty' just either change all the colors to the same as the form's background OR hide it (send to back) behind another control on the form. Then:

let's say your admin name is displayed in textbox1 and your hidden textbox is called textbox2 - oh and use one more to put the new password into or ever how you might want to do this.

Expand|Select|Wrap|Line Numbers
  1. if textbox1.text = textbox2.text then
  2.                 Me.SettingsBindingSource.RemoveCurrent()
  3.                 Me.Validate()
  4.                 Me.SettingsBindingSource.EndEdit()
  5.                 Me.TableAdapterManager.UpdateAll(Me.YourDataSourceNameHERE)
  6. end if
  7. ' now add your new record back
  8.         Me.SettingsBindingSource.AddNew()
  9.         textbox2.text = "adminuser"        
  10.         textbox3.text = "mynewpassword"
  11.         Me.Validate()
  12.         Me.SettingsBindingSource.EndEdit()
  13.         Me.TableAdapterManager.UpdateAll(Me.YourDataSourceNameHERE)
  14.  
This isn't the prettiest way to do this but this is exactly how I hide what is going on behind the scenes when I encrypt a username, product key, and activation code when the user actually activates my software.

It is kind of quirky but this is what I came up with late one night after working on some code to do ALL the above for like 9 hrs.
Feb 4 '11 #5
timr30017
9 New Member
oh i forgot one thing. Instead of just

END IF

do

ELSE ' this not the right record
settingsbinding source.movenext ()
END IF

But now thinking about it you will want to use a while statement or some kind of loop to ensure you get to the right record you want to change.
Feb 4 '11 #6
dexter delleva
12 New Member
does the "Me.YourDataSou rceNameHERE" signifies the dataadapter??
im going to try this... btw ive been working on a code i found on other sources and tried it but cant seem to figure out whats wrong.

this is the code:

Dim i, rwno As Integer
Dim colname As String
Dim value As Object
colname = "Password"
rwno = 0
value = TextBox3.Text
Try

''Update the column in the Student table. _Museum_finalDa taSet11.Tables( 0).Rows(1).Item (columnName:=co lname) = value
'Update the Student table in the testdb database.
i = LoginTableAdapt er1.Update(_Mus eum_finalDataSe t11)
Catch ex As Exception
MessageBox.Show (ex.Message)
End Try
'Displays number of rows updated.
MessageBox.Show ("no of rows updated=" & i)
Feb 4 '11 #7
dexter delleva
12 New Member
does the "Me.YourDataSou rceNameHERE" signifies the dataadapter??
im going to try this... btw ive been working on a code i found on other sources and tried it but cant seem to figure out whats wrong.

message box appears saying that "there is no row at position 1" but the password column in my table is row 1.

this is the code:
[list][*]Dim i, rwno As Integer[*] Dim colname As String[*] Dim value As Object[*] colname = "Password"[*] rwno = 0[*] value = TextBox3.Text[*] Try[*] [*] ''Update the column in the Login table.
  • _Museum_finalDa taSet11.Tables( 0).Rows(1).Item (columnName:=co lname) = value
  • 'Update the login table in the Museum-final database.
  • i = LoginTableAdapt er1.Update(_Mus eum_finalDataSe t11)
  • Catch ex As Exception
  • MessageBox.Show (ex.Message)
  • End Try
  • 'Displays number of rows updated.
MessageBox.Show ("no of rows updated=" & i)
Feb 4 '11 #8
dexter delleva
12 New Member
i really find it hard to understand.. im sorry. but i'll keep trying until i got it right.^^ tnx
Feb 4 '11 #9
dexter delleva
12 New Member
finally found a way how to change the password... tnx!
Feb 6 '11 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2661
by: Nicolae Fieraru | last post by:
Hi All, I am working on a web site in asp which will be hosted on a Windows 2003 server. I use the following code to connect to the database: Set objConn = Server.CreateObject("ADODB.Connection") Set objRS1 = Server.CreateObject("ADODB.Recordset") objConn.Provider = "Microsoft.Jet.OLEDB.4.0"
0
4204
by: Mike Knight | last post by:
(I've also posted this problem on microsoft.public.excel.programming) I have a MS Access 2003 Database named "AS400 Fields.mdb". This database contains links to tables on an AS400. In MS Excel 2003, I have VBA code that creates and executes queries using the Access database, and returns the results to an Excel sheet. The first time the query is executed, results are returned to Excel in usually less than 10 seconds. However, if the...
1
3410
by: webmaster | last post by:
I have a password protected Access Database (.MDB) file. I also have a Crystal Report with database fields connected to table in this database. I want to display the Crystal Report Preview Form using CRViewer. How to supply the password of the database, so that CRViewer is able to open the table at run-time?
1
1259
by: Bob Alston | last post by:
Anyone interested in using an Access database in an internet environment might be interested in reading the summary of my journey in this direction. I tried several web development environments, web site generators and even Access' Data Access Pages. Hopefully this will save you some headaches. http://members.cox.net/tulsaalstons/Documents/Microsoft%20Access%20Developer%20Transition%20to%20Internet.htm Bob
4
5912
by: Scott Nicholson | last post by:
I've got a site set up that uses a network share as it's home directory. Simple stuff is working fine. When I try to put a database in there, though, I run into problems. I'm using: dim dbconn,sql,dbcomm dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("test.mdb") & ";")
1
1639
by: Daniel | last post by:
Hello everyone, I am trying to connect to a password protected Access database using: Public connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathDB & ";User Id=admin;Password=Test;" as a connection string. When I try to connect to the database I receive an error message saying that the workgroup information file is missing or exclusively opened by another user.
2
2650
by: Felix Melendez | last post by:
Hi there! I'd like to know if anyone out there can give me a helping hand. I've developed an asp.net application that uses Forms Authentication. Question: I'd like to give users the ability that after every 30 days, they must change their passwords. So if the 30 days have passed, and user FELIX tries to log on, I want this user to be redirected to a ChangePwd.aspx web page. Once the user changes his/her password, he/she must be taken...
1
1129
by: MA P | last post by:
Hi! I am use to the include file on classic asp for maintaining MS Access database location. On using Visual Web Developer Express, I can only use the MS Access database if it is located on the same folder with the web app. Is there a way that I can locate MS Access as my database but the location is not located on the web application? Hope you might help. Me
0
1387
by: agent47 | last post by:
I don't know what the problem is with this query. It seems correct, but I guess it is not since it is not working. I'm using access as a database and C# language. Below is my sql text.. "SELECT priest_id, title + SPACE(1) + firstname + SPACE(1) + lastname + SPACE(1) + substring( middlename, 1, 1 ) as priestname FROM `priest` ORDER BY priestname" Thanks in advance, Joe Gan
4
3142
by: dillneus | last post by:
Hey I must do the News Storage database. It sounds pretty easy but there is one point I don't know how to do. When I download the news file and save it in .pdf. I have database that records all news and group it. then I want to store the file in appropriate folder (according to the issue) by using Access. For example - I record the news about England winning the Rugby semi-final. Then I want the file with the news to move to the...
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.