Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 paging(total records) sql command with asp

Author  Topic 

glafontaine
Starting Member

5 Posts

Posted - 2007-08-22 : 13:04:12
Hi,
I haven’t been able to get this working and at this point I lost hope and require help. Here is a bit of my code, all I want is the total number of records this gets. recordcount and count do not work with command and I have also tried with rs but no success. My result page displays correctly so the sql, ADO, asp everything works and I was able to display x per page but unable to get total records.

Thank you

<%
Dim var
Dim var_cmd
Dim var_numRows

Set var_cmd = Server.CreateObject ("ADODB.Command")
var_cmd.ActiveConnection = db_STRING


var_cmd.CommandText = "SELECT from 4 diff tables with innerjoins"


Dim var__MMColParam1

var__MMColParam1 = Request.QueryString("Id")
var_cmd.CommandText = var_cmd.CommandText + " AND Id2 LIKE ?"
var_cmd.Parameters.Append var_cmd.CreateParameter("param1", 5, 1, -1, var__MMColParam1) ' adDouble

Dim var__MMColParam2
var__MMColParam2 = Request.QueryString("Id3")
var_cmd.CommandText = var_cmd.CommandText + " AND Id3 LIKE ?"
var_cmd.Parameters.Append var_cmd.CreateParameter("param2", 5, 1, -1, var__MMColParam2) ' adDouble


etc for 6 paramaters


Set var = var_cmd.Execute
var_numRows = 0
%>
   

- Advertisement -