How should i update the database??

godkevin

New member
Joined
Apr 19, 2003
Messages
1
im currently doing a client-server programming. however i ve got problem in updating the password.. the code below is the function i wrote to update the password.. but when i go back and check the database, the password is not updated.. could someone help me please??



Function UpdatePassword(ByVal oPwd As String, ByVal nPwd As String)

Dim row As DataRow
DbD_ALL1.Clear()
Me.OleDbUpdateCommand1.CommandText = "Update Login Set Password = " & nPwd & " Where Password = " & oPwd & ""
Me.DBA_Users1.UpdateCommand = Me.OleDbUpdateCommand1
DBA_Users1.Fill(DbD_ALL1, nPwd) password

For Each row In DbD_ALL1.Tables(0).Rows
row("Pasword") = nPwd

Next
MsgBox("Password Updated")
End Function
 
hi,

i think you are not calling Dataset.Update to reflect the in memory changes back to the database. might be that is the reason your database is not geting updated. try checking if the changes you make in the memory are actually happenning using breakpoint in the code. if they are then you need to reflect then back to the database using Dataset.Update
 
Last edited by a moderator:
Back
Top