|
-
Mar 29th, 2004, 07:32 AM
#1
Thread Starter
Lively Member
Some One please help me
how i want to calculate the total of row in the database Access using vb.net ??
i very headache about it
thanx ~!
-
Mar 29th, 2004, 08:06 AM
#2
Hyperactive Member
Dear friend, I'm learning to use VB.NET, but perhaps I can help you. I suppose you use JET OLEDBProvider and ADO. You can:
Use an SQL Query like: "SELECT COUNT("NameOfAField") AS TotalRow FROM TabGOOFY"
Or, if you like me, use an ADODB.Recordset, you can simply:
Dim TotalRow as Integer=Rst.recordcount
Caution!!! This method (just as ".AbsolutePosition"), for my experience, works properly only with Static or Keyset cursor.
Dynamic, for example, is accepted sintatically, but it will be immediately converted to Keyset, without a message, but in this case sometimes does not work fine and the method will give you always -1
Strange, isn't it?
Live long and prosper (Mr. Spock)
-
Mar 29th, 2004, 09:14 AM
#3
Thread Starter
Lively Member
thanx
thank you for your help
i go to try 1
thanx
-
Mar 31st, 2004, 04:43 PM
#4
PowerPoster
Hi,
If your query is not sorted yet, what do you mean by
"how i want to calculate the total of row in the database Access "
the total number of rows in a database? or
the total number of rows in a table? or
the total value of all the fields in a row of a database table?
If either of the first two, if you want to do it when you have loaded then into a dataset etc you preface your code with
iCount =
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|