Results 1 to 4 of 4

Thread: Some One please help me

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    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 ~!

  2. #2
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    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)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    Talking thanx

    thank you for your help

    i go to try 1
    thanx

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    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
  •  



Click Here to Expand Forum to Full Width