|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I know if a RecordSet is open?Is there a way to determine of a Recordset object is open even if it
hasn't been created with a Command object (but just via conn.Execute(query))? Thanks. "kramer31" <kramer.newsrea***@gmail.com> wrote in message If (oRS.State And adStateOpen) = adStateOpen Thennews:1172703205.055714.265700@m58g2000cwm.googlegroups.com... > Is there a way to determine of a Recordset object is open even if it > hasn't been created with a Command object (but just via > conn.Execute(query))? 'recordset is open Else 'recordset is closed End If The State property is a bitmask so you should always mask the bit you're wanting to check. For example, in an asynchronous operation, the state could be a combination of adStateOpen and any of adStateConnecting, adStateExecuting, or adStateFetching. Too often, you'll see code like this: If oRS.State = adStateOpen Then This is NOT correct and COULD lead to bugs. It's irrelevant how the Recordset object got created. -- Mike Microsoft MVP Visual Basic
OT - MS: $4,000 for Daylight Saving Fix
Within a *.exe Function that returns an Array Reason for 'Set' keyword SendKeys command fails on Vista Error in reading large csv file Looking for a way to call LogOff and Shutdown. Getting Info from a .TTF File Cannot quit Excel called from VB6 Source Control via Network Drive |
|||||||||||||||||||||||