How To Implement Optional Parameter with UserConnection Designer (170371)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q170371 For a Microsoft Visual Basic .NET version of this
article, see
321902. SUMMARY Due to a limitation of ODBC, the UserConnection Designer
cannot directly implement a query based on stored procedures with optional
parameters. This article discusses two alternatives to work around this
limitation.
The first alternative is to create two (or more) query
objects based on user-defined SQL. Both query objects use ODBC call syntax to
invoke the same stored procedure; one using a parameter, the other without.
Depending on the situation, the client code can decide which query to
use.
The second option is to add a public method to the
UserConnection object. This method will decide the ODBC call syntax
dynamically, with or without parameters, and return the correct results.
REFERENCES For additional information, please see the following
articles in the Microsoft Knowledge Base: 166281 How To Create and Implement a UserConnection
(c) Microsoft Corporation 1997, All Rights Reserved.
Contributions by Adrian Chiang, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB170371 |
---|
|