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
[code=vb]
Private Function pass() As Boolean
Dim cn As New ADODB.Connectio n
Dim rs As New ADODB.Recordset
Dim sql As String
cn.Open = "provider=micro soft.jet.OLEDB. 4.0;Data source=F:\icici \database.mdb;P ersist security info=true"
sql = "update Table1 " & _
"set Password= '" & Text2.Text & "'" & _
"where Password= '" & Text1.Text & "'"
rs.Open sql, cn, adOpenStatic, adLockOptimisti c
cn.BeginTrans
cn.Execute sql
cn.CommitTrans
cn.Close
MsgBox "password has been changed successfully"
End Function
Private Sub Command1_Click( )
Call pass
End Sub
[/code]
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..
i have written the code but its giving error,my code is
[code=vb]
Private Function pass() As Boolean
Dim cn As New ADODB.Connectio n
Dim rs As New ADODB.Recordset
Dim sql As String
cn.Open = "provider=micro soft.jet.OLEDB. 4.0;Data source=F:\icici \database.mdb;P ersist security info=true"
sql = "update Table1 " & _
"set Password= '" & Text2.Text & "'" & _
"where Password= '" & Text1.Text & "'"
rs.Open sql, cn, adOpenStatic, adLockOptimisti c
cn.BeginTrans
cn.Execute sql
cn.CommitTrans
cn.Close
MsgBox "password has been changed successfully"
End Function
Private Sub Command1_Click( )
Call pass
End Sub
[/code]
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..
Comment