Macro Timing in Citrix (for user password change)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning,
I'm in Access 2000 and have a Macro that I've setup to run OnClick on my main form. My users will access the database form via Citrix / Thin Client, however the database itself is on a common area fileserver. The macro calls up the command to go to User and Group Accounts so my users can, when they want to, change their password. I then have SendKeys (actually, running BEFORE the RunCommand) type

+{TAB} {RIGHT}

This takes the dialog box to the Change User Password tab (the other has all the options disabled due to permissions, etc) so they can change their password. As Admin, I can obviously remove a password (Workgroup Information File) to let them reset it.

For some reason, when I run it on my Citrix client software (by ICA), the SendKeys action doesn't happen. However, it DOES run when I use the Access application from my PC to hit the database in the common area (and I have a command line switch to call up the WIF, so my users to have to join it and the general one on the Citrix server).

Can someone help?

Thanks!
Derek
 
GAK!

Users can change their own password from VBA code, using the NewPassword
method. Dump the sendkeys method! Sendkeys should always be an absolute,
100% last resort when there is no other way available. The NewPassword
method is what you want.

HTH,
TC


Derek Wittman said:
Good morning,
I'm in Access 2000 and have a Macro that I've setup to run OnClick on my
main form. My users will access the database form via Citrix / Thin Client,
however the database itself is on a common area fileserver. The macro calls
up the command to go to User and Group Accounts so my users can, when they
want to, change their password. I then have SendKeys (actually, running
BEFORE the RunCommand) type
+{TAB} {RIGHT}

This takes the dialog box to the Change User Password tab (the other has
all the options disabled due to permissions, etc) so they can change their
password. As Admin, I can obviously remove a password (Workgroup
Information File) to let them reset it.
For some reason, when I run it on my Citrix client software (by ICA), the
SendKeys action doesn't happen. However, it DOES run when I use the Access
application from my PC to hit the database in the common area (and I have a
command line switch to call up the WIF, so my users to have to join it and
the general one on the Citrix server).
 
I know, I know, I know. I think the 10 Commandments on the MVP website mentions "Thou shalt not use Sendkeys

Can you point me to a link for the NewPassword method? I've only done one function in VBA before, and that's to alter greetings in SendObject based on the time of day that the macro is run

Thanks
Dere

----- TC wrote: ----

GAK

Users can change their own password from VBA code, using the NewPasswor
method. Dump the sendkeys method! Sendkeys should always be an absolute
100% last resort when there is no other way available. The NewPasswor
method is what you want

HTH
T


Derek Wittman said:
Good morning
I'm in Access 2000 and have a Macro that I've setup to run OnClick on m
main form. My users will access the database form via Citrix / Thin Client
however the database itself is on a common area fileserver. The macro call
up the command to go to User and Group Accounts so my users can, when the
want to, change their password. I then have SendKeys (actually, runnin
BEFORE the RunCommand) typall the options disabled due to permissions, etc) so they can change thei
password. As Admin, I can obviously remove a password (Workgrou
Information File) to let them reset itSendKeys action doesn't happen. However, it DOES run when I use the Acces
application from my PC to hit the database in the common area (and I have
command line switch to call up the WIF, so my users to have to join it an
the general one on the Citrix server)
 
Online Help is a good reference to the newpassword method. Just go to the
Contents tab, & type "newpassword" (without the quotes).

I don't have Access on this PC, so the following code is untested, & "off
the top of my head". But it should be very close.

Put a button labelled "Change Password" on a suitable form. Code that
button's Click event, to execute the following code (in the code module of
that form):

dim sOld as string, sNew as string, u as user
sOld = inputbox ("Enter old password")
sNew = inputbox ("Enter new password")
set u = dbengine(0).users(currentuser)
on error resume next
u.newpassword sOld, sNew
if err.number = 0 then
msgbox "Password changed successfully"
else
msgbox "Error: " & err.description
endif
on error goto 0
set u = nothing

You'll need to check the number & order of parameters on the newpassword
method. I haven't used it for yonks, so those are from memory.

The method shown above is fairly crude. It would be nicer to pop-up a
seperate form with fields for old password, new password, & new password
repeated. But this should get you started, & it is waaaaaaaaaaay better than
the sendkeys method.

HTH,
TC


Derek Wittman said:
I know, I know, I know. I think the 10 Commandments on the MVP website
mentions "Thou shalt not use Sendkeys"
Can you point me to a link for the NewPassword method? I've only done one
function in VBA before, and that's to alter greetings in SendObject based on
the time of day that the macro is run.
 
Thanks, TC. I'll have to see what my users think of it. It's a database that helps me in my support role - and is MUCH more effecient than tracking a boatload of emails for requests.

Derek

----- TC wrote: -----

Online Help is a good reference to the newpassword method. Just go to the
Contents tab, & type "newpassword" (without the quotes).

I don't have Access on this PC, so the following code is untested, & "off
the top of my head". But it should be very close.

Put a button labelled "Change Password" on a suitable form. Code that
button's Click event, to execute the following code (in the code module of
that form):

dim sOld as string, sNew as string, u as user
sOld = inputbox ("Enter old password")
sNew = inputbox ("Enter new password")
set u = dbengine(0).users(currentuser)
on error resume next
u.newpassword sOld, sNew
if err.number = 0 then
msgbox "Password changed successfully"
else
msgbox "Error: " & err.description
endif
on error goto 0
set u = nothing

You'll need to check the number & order of parameters on the newpassword
method. I haven't used it for yonks, so those are from memory.

The method shown above is fairly crude. It would be nicer to pop-up a
seperate form with fields for old password, new password, & new password
repeated. But this should get you started, & it is waaaaaaaaaaay better than
the sendkeys method.

HTH,
TC


Derek Wittman said:
I know, I know, I know. I think the 10 Commandments on the MVP website
mentions "Thou shalt not use Sendkeys"function in VBA before, and that's to alter greetings in SendObject based on
the time of day that the macro is run.
Thanks! Derek
----- TC wrote: -----
GAK!
Users can change their own password from VBA code, using the
NewPassword
method. Dump the sendkeys method! Sendkeys should always be an absolute,
100% last resort when there is no other way available. The NewPassword
method is what you want.
 
Back
Top