07-24-2023, 05:32 AM
> **Possible Duplicate:**
> [How can I get the # of rows affected by a statement using ADO with JavaScript?](
<!-- End of automatically inserted text -->
We're using MS-SQL7.0, ASP(with Jscript)
there isn't any problem in querying and executing.
But we faced an problem getting affected record count.
We refer to this source
Here is our source code
var query = "...";
this.db = Server.CreateObject("ADODB.Connection");
this.db.Open(this.connectionString);
this.db.Execute(query, this.rowCount);
Response.Write(this.rowCount);
or
var query = "...";
this.db = Server.CreateObject("ADODB.Connection");
this.cmd = Server.CreateObject("ADODB.Command");
this.cmd.ActiveConnection = this.db;
this.cmd.CommandText = query;
this.cmd.Execute(this.rowCount);
Response.Write(this.rowCount);
But this code don't work, `rowCount` are set to its initial value(0).
I think it because primitive type in javascript is always called by value.
[1]:
> [How can I get the # of rows affected by a statement using ADO with JavaScript?](
[To see links please register here]
)<!-- End of automatically inserted text -->
We're using MS-SQL7.0, ASP(with Jscript)
there isn't any problem in querying and executing.
But we faced an problem getting affected record count.
We refer to this source
[To see links please register here]
Here is our source code
var query = "...";
this.db = Server.CreateObject("ADODB.Connection");
this.db.Open(this.connectionString);
this.db.Execute(query, this.rowCount);
Response.Write(this.rowCount);
or
var query = "...";
this.db = Server.CreateObject("ADODB.Connection");
this.cmd = Server.CreateObject("ADODB.Command");
this.cmd.ActiveConnection = this.db;
this.cmd.CommandText = query;
this.cmd.Execute(this.rowCount);
Response.Write(this.rowCount);
But this code don't work, `rowCount` are set to its initial value(0).
I think it because primitive type in javascript is always called by value.
[1]:
[To see links please register here]