The information in this article applies to:
Advanced: Requires expert coding, interoperability, and multiuser skills. SYMPTOMSWhen you create an SQL pass-through query in a Visual Basic for Applications procedure, you may receive the following error message when you try to set the LogMessages property of the QueryDef object.
CAUSELogMessages is an extended property that cannot be addressed directly as a property of the QueryDef object because an extended property does not exist within the QueryDefs collection. You can use the property sheet of a query to set the LogMessages property setting, or you can use the CreateProperty() function in code to append the LogMessages property to the query object. You can then set the property in your procedure. RESOLUTIONBecause the LogMessages property is an extended property, it must be defined and then appended to the QueryDef object before you can set the value of the property. For example, given a QueryDef object dimensioned as MyQD, you need to add the following code to your Visual Basic for Applications procedure before you set the LogMessages property:
After MyProp is appended to the Properties collection of MyQD, use the following syntax when you reference the LogMessages property:
MORE INFORMATIONSteps to Reproduce BehaviorThe following sample code demonstrates the error message that occurs when you try to set the LogMessages property of the QueryDef object.
The following code demonstrates how to change the sample code above to set the LogMessages property correctly:
Additional query words: prb
Keywords : kberrmsg kbusage kbdta QryPass |
Last Reviewed: May 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |