Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.RecordCount issue in VB6

Status
Not open for further replies.

Perilous1

IS-IT--Management
Mar 10, 2005
171
US
I know how to get the RecordCount of a Access table in vb6, but is there a way to get the RecordCount of a specific field only within that table?

I have three fields within the table (machine, device and misc). Just doing the basic .RecordCount command will return the record count for just the first field (machine). How do I specify that I want the record count of the 2nd or 3rd field?
 
Thanks - looks interesting.
What I meant was a program like vb6 that would run on an android rather than a program running in Windows or Mac that produced a run time app that would run on an Android.
Windows would not be in the picture at all.
 
Erm ... the idea of prgramming anything much longer than a "Hello World" program directly on a a phone sounds like hell to me, I have to say.
 
Got to the party a little late. Just wanted to mention there is a poorly documented feature of the ADO command object that returns number of records affected. Example:
Code:
    strSQL = "UPDATE tblInvoiceHeaderXref SET VALIDATE = 1"
    cmdCommand.CommandText = strSQL
    cmdCommand.Execute lngRecordCount

This assumes a variable declared as Long, and a valid command object that already been instantiated and connected.

By manipulating the SQL with a meaningful WHERE clause it is easy to return needed counts. In this simple example VALIDATE is a dummy field, so lngRecordCount simply returns a recordcount.

Gluais faicilleach le cupan làn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top