MainForm.Conn.StartTransaction; UserManagerQuery.SQL.Clear; UserManagerQuery.SQL.Text := 'UPDATE tabusers SET ' + // 'username=:username, userpwd=:userpwd, usernickname=:usernickname, ' + 'useroffice=:useroffice, userprofiles=:userprofiles, ' + 'userpermission=:userpermission, useronline=:useronline ' + 'WHERE ID=' + edtID.Text; UserManagerQuery.Params[0].AsString := edtUserName.Text;// name if Using_Default_Pwd then UserManagerQuery.Params[1].AsString := Default_Password else UserManagerQuery.Params[1].AsString := MD5Print(MD5StringA(AnsiString(edtUserPwd.Text))); // password UserManagerQuery.Params[2].AsString := edtUserNickName.Text; // nickname UserManagerQuery.Params[3].AsString := edtUserOffice.Text; // office MS := TMemoryStream.Create; ImgUserProfiles.Picture.SaveToStream(MS); MS.Position := 0; UserManagerQuery.Params[4].LoadFromStream(MS, ftBlob); // profile MS.Free; UserManagerQuery.Params[5].AsString := edtUserPermission.Text; //permission UserManagerQuery.Params[6].AsBoolean := False; //online UserManagerQuery.ExecSQL; MainForm.Conn.Commit;
真TMD的爽,快抛弃 EDIT/POST 这么落后的玩意吧。