When I run an update in SQL Query Analyzer or any other interface,
it always says "2 row(s) affected" or whatever number. Shouldn't
I be able to get this number qry.RecordCount? I get CF errors like
RecordCount doesn't exist. The docs on CFQUERY don't mention anything
about the RecordCount variable not even existing when you run an update.

What I am trying to do is allow a user to update their password, but
I only want to use one call to the database to do it. They have to
enter their old password, so at first I was going to do a lookup
and make sure their old password was correct, then run an update
and set the new password. But then I thought I could combine it,
like this:

<CFQUERY NAME="qry" DATASOURCE="DSN">
UPDATE site SET password = <CFQUERYPARAM VALUE="#Hash(Attributes.password)#">
WHERE siteid = #Client.siteid# AND 
password = <CFQUERYPARAM VALUE="#Hash(Attributes.oldpassword)#">
</CFQUERY>

So that should update their password ONLY if the old password they entered
was correct. Then I was going to check qty.RecordCount, and if it was
zero, they must have entered in the wrong password, show that error.

Any ideas? DB is MS SQL Server.
Thanks,
RYAN


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to