RecordsAffected property of ADO Command.Execute()

Results 1 to 2 of 2

Thread: RecordsAffected property of ADO Command.Execute()

  1. #1
    Join Date
    Dec 1969

    Default RecordsAffected property of ADO Command.Execute()

    Dear Sir,<BR>I&#039;m now working on an ASP database application. It&#039;s connected through ODBC with MS Access database. However, I come across a tricky problem. As we know, there&#039;re three arguments for ADO Command.Execute() method. All I want is to get the &#039;RecordsAffected&#039; value returned by the method so that I can check whether the action query is successful or not. I&#039;ve tried scripting it up with VBScript. It does work fine and there&#039;s value returned by &#039;RecordsAffected&#039;. But, if I do this with JScript, it only returns &#039;0&#039; for all sort of methods I tried.<BR><BR>Can anyone have any idea to solve this for me, please? Any examples for JScript version of it?<BR><BR>Here I attached my testing script for your reference:<BR>&#060;script language=jscript&#062;<BR>var oCnn=new ActiveXObject("ADODB.Connection");<BR>var oCmd=new ActiveXObject("ADODB.Command");<BR>var iAffected=new Number();<BR><BR>oCnn.ConnectionString="Provider=M SDASQL;DSN=inventory"; <BR>oCnn.Open();<BR>oCmd.ActiveConnection=oCnn;<BR >oCmd.CommandText="insert into Brand (BrandName,Abbr) values (&#039;abc&#039;,&#039;abc&#039;)";<BR>oCmd.Comman dType=1;<BR>oCnn.Execute(iAffected);<BR>oCnn.Close ();<BR>&#060;/script&#062;<BR><BR>Thanks,<BR><BR>Leonard

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default You are tryint to do this on the client

    you CANNOT<BR><BR><BR>You MAY want to read this FAQ# 169

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts