Results 1 to 8 of 8

Thread: Record Count

  1. #1
    idover
    Guest
    Hi, I am in the process of buildig an interface for MySql. I have no problems returning a list of databases, the tables in each, and the description of each table. However, I am forced to use the Command object in doing this. I need to return the number of records that is populating a table explanation. I am unable to use the .RecordCount property due to the type of recordset that the command object returns. Perhaps a nested SQL statement? e.g. : select count(*) from 'explain table_whatever' haven't tried this... thanks for your help!! Any ideas of other ways to get the record count? Note that this is NOT a normal recordset, this recordset is a description of a table (fields, data types, keys, etc) so select count(*) by itself will not work. Thanks for your help!

  2. #2
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613
    Try this:

    Code:
        lngCount = 0
        Do While Not rs.EOF
            lngCount = lngCount + 1
            rs.MoveNext
        Loop

    Regards,
    TheBao

  3. #3
    Guest
    thanks for your suggestion! at this point, that's exactly what i'm using. however, i'm trying to keep this app as efficient as possible, so this is only a temporary solution... thanks again!

  4. #4
    Member
    Join Date
    Jan 2001
    Posts
    56
    What are you using for your frontend? If you have the ability to use a standard Data Control (DAO), then you are in luck. Use the datacontrolname.recordset.recordcount property after selecting just one field in its entirety. I hope that makes sense.

  5. #5
    Guest
    unfortunately, i'm not using any controls directly per se... i'm forced to use the command object to retrieve information from the server, and place it in a flex grid... at this point i have been forced to use the old loop method to retrieve the record count... since the information is only information concerning each table, it's not much of a hinderance... but i've learned a few tricks from this...

    anyone that would like to see the app in it's early pre alpha stages, let me know... it's strictly for MySQL users and only on the Win32 platform... and i could use the debugging help... thanks!

  6. #6
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    set your recordset object to use a client side cursor:

    example

    dim objRS as Recordset

    objrs.cursorlocation = adUseClient
    objrs.open CommandObject

    with a client side cursor you will then be able to use the .Recordcount property of the recordset

  7. #7
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    Small world, idover - I'm in Atlanta too! I've thought about building a front end admin app for mySQL but I guess I'm too lazy. I wish there was an admin app for mySQL that is as user friendly as SQL Server's Enterprise Manager. I would like to get a look at your app though and offer any assistance that I could.

    Thanks.
    Um americano que fala portugues.

  8. #8
    Guest
    great ttingen! you can send an email to me after checking profile... btw... i work for a company that caters to spanish and portuguese speakers worldwide... the world gets smaller yet...

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