How to get the No of Affected Records in ASP + ADODB + Javascript ?

How to get the No of Affected Records in ASP + ADODB + Javascript ?

am 06.12.2006 14:15:33 von k.visube

anyone give a look at my problem.

Here is my problem.

This is a snippet in my ASP project
here in i ve used javascript as the scripting language..
var lngRecsAffected=0;
var sql="update tbl_usermaster SET pass='" + newPass + "' where
uname='admin' and pass='"+ oldPass +"'" ;
RSCommand.Commandtext=sql;
RSCommand.Activeconnection=con;
RSCommand.Execute (lngRecsAffected) ;
Response.Write("
Records Affected : "+lngRecsAffected);

here i am getting 0 as response for the successful updation as well
as unsuccessfull updation.

In Vbscript i know how to find the no of afftected records while
executing a update/delete/insert query..

but here in javascript i dont know the procedure to get no of affected
records.

Based on that value i will show response messages like records updation
is successful or failure so on..

Can anyone help me in this regard.?

Advance thanx for the suggestions.

Regards,
Visu.

Re: How to get the No of Affected Records in ASP + ADODB + Javascript ?

am 10.12.2006 14:36:57 von reb01501

visu wrote:
> anyone give a look at my problem.
>
> Here is my problem.
>
> This is a snippet in my ASP project
> here in i ve used javascript as the scripting language..

The solution may depend on the database type and version. Never ask a
database-related question without providing this information.

> var lngRecsAffected=0;
> var sql="update tbl_usermaster SET pass='" + newPass + "' where
> uname='admin' and pass='"+ oldPass +"'" ;
> RSCommand.Commandtext=sql;
> RSCommand.Activeconnection=con;
> RSCommand.Execute (lngRecsAffected) ;

I believe in jscript you need to supply values for all the arguments. The
Execute method as three arguments
(http://msdn.microsoft.com/library/en-us/ado270/htm/mdmthcmd execute.asp);
you have only supplied one.



--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"