Article ID: 249175 - Last Review: April 7, 2006 - Revision: 2.0 FIX: Storing an ADO Recordset in GIT Might Cause An Access ViolationThis article was previously published under Q249175 On This PageSYMPTOMS
The following paragraph is taken from the Microsoft Knowledge Base article 248287
(http://support.microsoft.com/kb/248287/EN-US/
)
, "Understanding ADO Marshaling", which describes the potential problem of using the COM Global Interface Table with ActiveX Data Objects (ADO) Recordsets.
"COM provides a component called the Global Interface Table (GIT). The GIT allows an application to store a reference to an object's interface in the table so that the interface pointer can be retrieved at any time. When storing the interface pointer into the GIT, the object is queried for IMarshal and if IMarshal is exposed by the object, the marshaling data of the object is placed into a stream where it can be retrieved at some later time when the interface pointer is retrieved. IMarshal is exposed by the client cursor which actually does the passing of the recordset data. There is a problem if an open ADO Recordset object which uses adUseClient is placed into the GIT and then is later revoked from the table. An access violation will occur. To avoid the problem, place the Recordset's interface pointer into the GIT before calling Open on the Recordset. This will place the interface pointer into the GIT before the client cursor engine is invoked which will essentially cause standard marshaling to occur rather than record data being streamed from the cursor engine through IMarshal. Only a pointer to the ADO Recordset's interface will be stored in this case which is the real intent of the programmer." RESOLUTION
To avoid an access violation in your code you can either apply the hotfix listed in this article, or you can use one of the following workarounds:
If a call to an ADO method returns a recordset that is already open, you can use the following steps to work around the problem:
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in MDAC 2.6. A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Data Access Components release that contains this hotfix. To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.The English version of this fix should have the following file attributes or later: Date Time Version Size File Name Platform -------------------------------------------------------------------- 05/04/2000 19:32 2.51.5303.1 327,952 Msadce.dll x86 05/03/2000 19:31 2.51.5303.0 487,696 Msado15.dll x86 MORE INFORMATIONSteps to Reproduce Behavior
REFERENCES
| Article Translations
|

Back to the top
