[AccessD] Help with syntax please....OpenRecordset

jeffrey.demulling at usbank.com jeffrey.demulling at usbank.com
Thu Oct 14 15:06:11 CDT 2004


>   It's hit or miss depending on the size of the recordset.  If JET thinks
> it's going to take too long to fully populate it, it finishes the job in
the
> background.  Code starts executing again while this is going on, so
> .Recordcount will be incorrect when this happens.

Why not use something along the lines of?

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim mysql as string

mysql = "SELECT"
mysql = mysql & " Count(CONTACTS.CONTACTKEY) AS RecordCount"
mysql = mysql & " FROM"
mysql = mysql & " CONTACTS;"

Set db = CurrentDb
Set rst = db.OpenRecordset(mysql)
MsgBox rst.Fields("RecordCount")


------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.
==============================================================================




More information about the AccessD mailing list