HOWTO: Use the ODBC API Function SQLExecDirect with RDOLast reviewed: June 24, 1997Article ID: Q154046 |
The information in this article applies to:
SUMMARYBecause RDO exposes the hEnv, hDbc, and hStmt properties of the ODBC API to the programmer, you are able to utilize ODBC API calls in conjunction with RDO. This can be helpful if RDO does not implement a feature of the ODBC API that you would like to use. This article gives an example of how to use the ODBC API SQLExecDirect function in combination with the RDO rdoConnection.hDbc property to execute SQL without the use of the rdoConnection.Execute method.
MORE INFORMATIONProgramming directly to the ODBC API gives you an alternative to using RDO and DAO code to access your ODBC database. This direct method allows the programmer to have low-level control over the ODBC datasource, but introduces the Visual Basic 4.0 programmer to a complex programming model that requires in-depth knowledge of the ODBC 2.0 specification. If you feel that you can benefit from this direct approach, before you proceed you should obtain a copy of the ODBC 2.0 Programmer's Reference and SDK Guide that fully documents the ODBC API.
Sample ProgramThis example uses the ODBC API SQLExecDirect function in combination with the rdoConnection.hDbc property to execute SQL without the use of the RDO Execute method. It uses SQL Server and the Pubs database, but you can change the DSN and SQL to match your ODBC database.
REFERENCESBuilding Client/Server applications with Visual Basic Manual, Chapter 10, "Using the ODBC API." ODBC 2.0 Programmer's Reference and SDK Guide, MS Press. Hitchhiker's Guide to Visual Basic and SQL Server, Microsoft Press, ISBN: 1-55615-906-4.
|
Additional query words: rdoConnection Execute
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |