Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How can count RecordSet

Reply
Thread Tools

How can count RecordSet

 
 
Jack
Guest
Posts: n/a
 
      01-20-2004
Hello,
<%@ Language=VBScript %>
<%
Dim shipment_db
Dim shipmentTable
Set shipment_db = Server.CreateObject("ADODB.Connection")
Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
Response.Write shipmentTable.RecordSetCount 'This line is error
%>
But this program can't count recordset.
Thank you

 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      01-20-2004
Jack wrote:
> Hello,
> <%@ Language=VBScript %>
> <%
> Dim shipment_db
> Dim shipmentTable
> Set shipment_db = Server.CreateObject("ADODB.Connection")
> Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
> Response.Write shipmentTable.RecordSetCount 'This line is error
> %>
> But this program can't count recordset.
> Thank you


As you will see in this article, the method you choose to use depends on
your database. Always tell use the type and version of database you are
using.

http://www.aspfaq.com/show.asp?id=2193

For a further explanation of the effect of cursor type on record count, see
here:
http://msdn.microsoft.com/library/en...mdapro05_9.asp

HTH,
Bob Barrows
--
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"


 
Reply With Quote
 
 
 
 
Jack
Guest
Posts: n/a
 
      01-20-2004
It's myself.
My DataBase is Microsoft Access 2000,linked by ODBC Driver.

 
Reply With Quote
 
Bhaskaran.B
Guest
Posts: n/a
 
      01-20-2004
<%
Dim shipment_db
Dim shipmentTable
Set shipment_db = Server.CreateObject("ADODB.Connection")
Set shipmentTable = Server.CreateObject("ADODB.Recordset")
shipmentTable .open "SELECT * FROM shipment", shipment_db ,1,1
Response.Write shipmentTable.RecordCount
%>

Bj.Bhaskaran.B
IGI - SCT

"Jack" <(E-Mail Removed)> wrote in message news:#(E-Mail Removed)...
> Hello,
> <%@ Language=VBScript %>
> <%
> Dim shipment_db
> Dim shipmentTable
> Set shipment_db = Server.CreateObject("ADODB.Connection")
> Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment")
> Response.Write shipmentTable.RecordSetCount 'This line is error
> %>
> But this program can't count recordset.
> Thank you
>

 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      01-20-2004
Jack wrote:
> It's myself.
> My DataBase is Microsoft Access 2000,linked by ODBC Driver.


Great.
Now just remember to provide this information the next time you post a
question.

I do suggest you drop the ODBC driver and use the native Jet OLEDB provider
instead. ODBC is being deprecated, and MS recommends using OLEDB if
available for your database (which it is). See here for connection string
examples:

http://www.able-consulting.com/MDAC/...orMicrosoftJet

HTH,
Bob Barrows
--
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"


 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      01-20-2004
Thank you very much

 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      01-20-2004
Thank you

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Recordset for page count tchangmian ASP General 1 04-04-2005 11:01 AM
Count(*) in a Subquery with multiple tables: How does SQL determine which table to generate the Count() from? Kaimuri MCSD 3 12-29-2004 06:38 PM
I am adding a new row to the datagrid dynamically but if i use the Count property of Item it is not showing the count of the new rows being added Praveen Balanagendra via .NET 247 ASP .Net 2 06-06-2004 07:16 AM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM



Advertisments