473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Update Recordset in MS Access

pbala
37
Hello,
I have problem in reset the new password with old one.For that I used the code as
Expand|Select|Wrap|Line Numbers
  1. Set rstreset = New ADODB.Recordset
  2. strtable = "Update USERS SET rstreset!Password = '" & upwd & "' where UserName='" & uname & "'"
Now I want to update it.How to update this?
Feb 18 '09 #1
3 3572
NeoPa
32,556 Expert Mod 16PB
Very confusing question.

You say you've used this code, yet this isn't workable code. It cannot work.

Without this to give a clue there is no sense in the question.
Feb 18 '09 #2
NeoPa
32,556 Expert Mod 16PB
It seems this could work as :
Expand|Select|Wrap|Line Numbers
  1. strTable = "Update USERS SET [Password]='" & upwd & "' WHERE [UserName]='" & uname & "'"
But I still don't understand what your question is. What do you want help with?
Feb 18 '09 #3
ADezii
8,834 Expert 8TB
@pbala
I'll assume you have a Table named USERS and you wish to Update the Password of a User named uname to upwd. Should that be the case, you can use the following code as a Basic Template:
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2. Dim upwd As String
  3. Dim uname As String
  4.  
  5. upwd = "New Password"
  6. uname = "ADezii"
  7.  
  8. 'Does the User even exist?
  9. If DCount("*", "USERS", "[UserName] = '" & uname & "'") = 0 Then
  10.   MsgBox "The User " & uname & " is not a valid User Name!", vbExclamation, "No User"
  11.     Exit Sub
  12. End If
  13.  
  14. strSQL = "Update USERS SET USERS.[Password] = '" & upwd & _
  15.          "' Where USERS.[UserName] ='" & uname & "'"
  16.  
  17. CurrentDb.Execute strSQL, dbFailOnError
Feb 18 '09 #4

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

Similar topics

0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
2
by: rp | last post by:
Not sure if this is an Access Issue or ASP but here goes I have an asp script which does an which opens up a recordset against an access table I then do a .AddNew. <insert the date into the...
1
by: Just_Buy | last post by:
Environment: MS Access 97 Problem: Trying to force a record to update using the recordset.Update property. What syntax do I need to force a record to be updated? I have searched the...
2
by: Joseph Markovich | last post by:
I'm having some trouble with VB in Access 2000. I have a form that the user enters in just one number (in this case, it's a base salary) and then the program is going to do a bunch of math (which...
3
by: Ken | last post by:
The following code results in a recordset where every other record of tblOne has =True. The recordset count is correct but one record is skipped; exactly half the records are updated to True. Why...
2
by: Nono | last post by:
Hello, I have an Access Database that I want to update using an Excel spreadsheet. When it is new reccords, I know how to do it. Nevertheless when I want to complete the information on a...
4
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
6
by: Matt | last post by:
I'm having difficulty with trying to update a Access memo field through an SQL statement where the value I'm trying to pass is longer than 255 characters. The field is being truncated. I'm using...
2
by: DaveN | last post by:
Hi all, I'm trying to update a record in a table with data from text boxes on a form. As a background to this, I managed to add a new record to the table in a similar manner with the following:...
1
by: sphinney | last post by:
All, I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.