473,388 Members | 1,526 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,388 software developers and data experts.

how to change password and to update the changed password

66
plz help me to write the code to change the current password and to update the new password:

i have written the code but its giving error,my code is
Expand|Select|Wrap|Line Numbers
  1. Private Function pass() As Boolean
  2. Dim cn As New ADODB.Connection
  3. Dim rs As New ADODB.Recordset
  4. Dim sql As String
  5.  
  6. cn.Open = "provider=microsoft.jet.OLEDB.4.0;Data source=F:\icici\database.mdb;Persist security info=true"
  7.  
  8. sql = "update Table1 " & _
  9.      "set Password= '" & Text2.Text & "'" & _
  10.      "where Password= '" & Text1.Text & "'"
  11. rs.Open sql, cn, adOpenStatic, adLockOptimistic
  12.  
  13.  
  14. cn.BeginTrans
  15. cn.Execute sql
  16. cn.CommitTrans
  17.  
  18.  
  19. cn.Close
  20. MsgBox "password has been changed successfully"
  21. End Function
  22.  
  23. Private Sub Command1_Click()
  24. Call pass
  25. End Sub
  26.  
  27.  
compiler error: expected a function or variable in "cn.open="" "line.am using vb6.0 as front end and database is Ms Access with ADODC..
Oct 23 '07 #1
7 19649
Expand|Select|Wrap|Line Numbers
  1. Private Function pass() As Boolean
  2. Dim cn As New ADODB.Connection
  3. Dim sql As String
  4.  
  5. cn.Open "provider=microsoft.jet.OLEDB.4.0;Data source=F:\icici\database.mdb;Persist security info=true"
  6.  
  7. sql = "update Table1 " & _
  8.      "set Password= '" & Text2.Text & "'" & _
  9.      "  where Password= '" & Text1.Text & "'"
  10. cn.Execute(sql)
  11. cn.Close
  12. Set cn = Nothing
  13. MsgBox "password has been changed successfully"
  14. End Function
  15.  
  16. Private Sub Command1_Click()
  17. Call pass
  18. End Sub
  19.  
Please make sure to insert some spaces before the where clause and remove the "=" sign in cn.open
Oct 24 '07 #2
rekhasc
66
Expand|Select|Wrap|Line Numbers
  1. Private Function pass() As Boolean
  2. Dim cn As New ADODB.Connection
  3. Dim sql As String
  4.  
  5. cn.Open "provider=microsoft.jet.OLEDB.4.0;Data source=F:\icici\database.mdb;Persist security info=true"
  6.  
  7. sql = "update Table1 " & _
  8.      "set Password= '" & Text2.Text & "'" & _
  9.      "  where Password= '" & Text1.Text & "'"
  10. cn.Execute(sql)
  11. cn.Close
  12. Set cn = Nothing
  13. MsgBox "password has been changed successfully"
  14. End Function
  15.  


when i run d prog its giving error
could not find installable ISAM.....
can any one help me plz
Oct 24 '07 #3
debasisdas
8,127 Expert 4TB
Find details regarding the topic here.
Oct 24 '07 #4
rekhasc
66
Find details regarding the topic here.


i am using access 2007 is this the reason for that error ....
if any changes required for access 2007...
Oct 24 '07 #5
debasisdas
8,127 Expert 4TB
i am using access 2007 is this the reason for that error ....
if any changes required for access 2007...
follow the first few searched links in the provided link for the reply.
Oct 24 '07 #6
i am using access 2007 is this the reason for that error ....
if any changes required for access 2007...

If it it Access 2007 I beleive the connection string should be:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\icici\database.mdb;Persist Security Info=False"

But I seriously doubt because the Access 2007 file have an extension .accdb where as you file has a .mdb extension which tells that you are still using a Access 2000 thru 2003 file.

So I am in the impression that you do not have all the Microsoft data access components, please download the latest MDAC from:
http://www.microsoft.com/downloads/d...displaylang=en

Before making any code changes.
Oct 24 '07 #7
' set a password to a existing database in vb6...



dim db as database

Set db = OpenDatabase(App.Path & "\database.mdb", True, False, ";pwd=" & false)

db.newpassword "","Password"




' change password


dim db as database

Set db = OpenDatabase(App.Path & "\database.mdb", True, False, ";pwd=" & "old_password")

db.newpassword "old_password","new_Password"
Sep 7 '13 #8

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

Similar topics

13
by: joltman | last post by:
We're working on an intranet site where we will require user's to only be able to access their own page in some instances. Rather than introducing another password to the mix, we were thinking...
1
by: fred | last post by:
Has anyone had any success forcing user to change their logon passwords? Code for Access 2003 or any prior version would be helpful. Please reply to list or to my email. Thank you, Fred...
4
by: Srikanth | last post by:
Hi All, Can any one tell me how to change windows user account password by programmatically using C#? I don't have administrator privileges and I want to change my account password by...
7
by: Nerrad | last post by:
Hi, i am currently working on a project which requires me to create a form to allow the user to change their password. I know there is a user-level security login which is easier and safer but...
6
by: Darren | last post by:
hi y'all! i pretty much wanted to do a custom form where users can change their password to the database as they like.. the problem i encountered is that it seems that when a valid user enter...
3
by: VB Programmer | last post by:
Right now, if you use the CreateUserWizard for ASP.NET 2.0 a valid password is this: Password length minimum: 7. Non-alphanumeric characters required: 1. How do I change it so that a valid...
4
by: Skeets | last post by:
i have an application that should allow acces to linux administrators only. iow, i want to code a php script that will be able to compare the entered password with the linux adminstrator's...
1
by: binder | last post by:
I have a stored procedure that inserts values into five columns of a table. I need another stored procedure that will allow the user to pass one or more of those parameters and update only the...
2
by: Erick Otieni | last post by:
Hi all, Does anyone have an idea to solve this problem in asp? I have tried to look everywhere for the last week but no one seems to have the answer. The issue is that I have the script below...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...

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.