Added:
trunk/Driver/examples/
trunk/Driver/examples/c/
trunk/Driver/examples/c/README.txt
trunk/Driver/examples/c/tutorial_01.c
trunk/Driver/examples/c/tutorial_02.c
trunk/Driver/examples/c/tutorial_03.c
trunk/Driver/examples/c/tutorial_04.c
trunk/Driver/examples/c/tutorial_05.c
trunk/Driver/examples/c/tutorial_06.c
trunk/Driver/examples/c/tutorial_07.c
trunk/Driver/examples/c/tutorial_08.c
trunk/Driver/examples/c/tutorial_09.c
trunk/Driver/examples/cpp/
trunk/Driver/examples/cpp/ADO/
trunk/Driver/examples/cpp/ADO/5.gif
trunk/Driver/examples/cpp/ADO/ADO.pro
trunk/Driver/examples/cpp/ADO/main.cpp
trunk/Driver/examples/vb/
trunk/Driver/examples/vb/7/
trunk/Driver/examples/vb/7/AssemblyInfo.vb
trunk/Driver/examples/vb/7/Module1.vb
trunk/Driver/examples/vb/7/VB-ADO.sln
trunk/Driver/examples/vb/7/VB-ADO.suo
trunk/Driver/examples/vb/7/VB-ADO.vbproj
Removed:
trunk/examples/
Modified:
trunk/Driver/Driver/Library/SQLAllocHandle.cpp
trunk/Driver/Driver/Library/SQLConnectW.cpp
trunk/Driver/Driver/Library/SQLDisconnect.cpp
trunk/Driver/Driver/Library/SQLExecDirectW.cpp
trunk/Driver/Driver/Library/SQLFetch.cpp
trunk/Driver/Driver/Library/SQLFreeHandle.cpp
trunk/Driver/Driver/Library/SQLGetConnectAttrW.cpp
trunk/Driver/Driver/Library/SQLGetCursorNameW.cpp
trunk/Driver/Driver/Library/SQLGetData.cpp
trunk/Driver/Driver/Library/SQLGetEnvAttr.cpp
trunk/Driver/Driver/Library/SQLGetFunctions.cpp
trunk/Driver/Driver/Library/SQLGetInfoW.cpp
trunk/Driver/Driver/Library/SQLGetStmtOption.cpp
trunk/Driver/Driver/Library/SQLNumParams.cpp
trunk/Driver/Driver/Library/SQLParamData.cpp
trunk/Driver/Driver/Library/SQLRowCount.cpp
trunk/Driver/Driver/Library/SQLSetEnvAttr.cpp
trunk/Driver/Driver/include/MYODBCDriver.h
trunk/Driver/User.doxygen
trunk/SDK/MYSQLPlus/Library/MEnvironment.cpp
trunk/SDK/MYSQLPlus/User.doxygen
trunk/SDK/MYSQLPlus/include/MEnvironment.h
trunk/connector-odbc.vpj
trunk/connector-odbc.vpw
trunk/doc/Header.html
Log:
ENH: Improving doxygen based documentation.
Modified: trunk/Driver/Driver/Library/SQLAllocHandle.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLAllocHandle.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLAllocHandle.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -61,6 +61,10 @@
\retval SQL_INVALID_HANDLE an invalid handle was given to function
\sa SQLFreeHandle
+
+ \include tutorial_01.c
+ \include tutorial_02.c
+ \include tutorial_05.c
*/
SQLRETURN SQL_API SQLAllocHandle( SQLSMALLINT nHandleType,
SQLHANDLE hInputHandle,
Modified: trunk/Driver/Driver/Library/SQLConnectW.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLConnectW.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLConnectW.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -29,6 +29,13 @@
*/
#include "MYODBCDriverInternal.h"
+/*!
+
+ \sa SQLDriverConnect
+ SQLBrowseConnect
+
+ \include tutorial_03.c
+*/
SQLRETURN SQL_API SQLConnectW( SQLHDBC hDbc,
SQLWCHAR * psServerName,
SQLSMALLINT nNameLength1,
Modified: trunk/Driver/Driver/Library/SQLDisconnect.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLDisconnect.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLDisconnect.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -49,6 +49,8 @@
SQLDriverConnect
SQLEndTran
SQLFreeConnect
+
+ \include tutorial_03.c
*/
SQLRETURN SQL_API SQLDisconnect( SQLHDBC hDbc )
{
Modified: trunk/Driver/Driver/Library/SQLExecDirectW.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLExecDirectW.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLExecDirectW.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -47,6 +47,8 @@
\retval SQL_ERROR Request failed.
\retval SQL_NO_DATA Searched update/delete statement did not affect any
rows.
\retval SQL_INVALID_HANDLE Invalid handle was provided.
+
+ \include tutorial_06.c
*/
SQLRETURN SQL_API SQLExecDirectW( SQLHSTMT hStm,
SQLWCHAR * psStatementText,
Modified: trunk/Driver/Driver/Library/SQLFetch.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLFetch.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLFetch.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -43,6 +43,8 @@
\retval SQL_ERROR Request failed.
\retval SQL_NO_DATA No data affected.
\retval SQL_INVALID_HANDLE Invalid handle was provided.
+
+ \include tutorial_09.c
*/
SQLRETURN SQL_API SQLFetch( SQLHSTMT hStm )
{
Modified: trunk/Driver/Driver/Library/SQLFreeHandle.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLFreeHandle.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLFreeHandle.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -43,6 +43,8 @@
\retval SQL_SUCCESS Request processed ok.
\retval SQL_ERROR Request failed.
\retval SQL_INVALID_HANDLE Invalid handle was provided.
+
+ \include tutorial_02.c
*/
SQLRETURN SQL_API SQLFreeHandle( SQLSMALLINT nHandleType,
SQLHANDLE hHandle )
Modified: trunk/Driver/Driver/Library/SQLGetConnectAttrW.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetConnectAttrW.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetConnectAttrW.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -36,9 +36,9 @@
\param hStm Viable statement handle.
\param nAttribute Desired attribute.
- \param pValuePtr Place to store the value for nAttribute.
+ \param pValue Place to store the value for nAttribute.
\param nBufferLength Size of the pValuePtr buffer.
- \param pnStringLengthPtr Place to store number of bytes available for pValuePtr.
+ \param pnStringLength Place to store number of bytes available for pValuePtr.
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLGetCursorNameW.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetCursorNameW.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetCursorNameW.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -37,7 +37,7 @@
\param hStm Viable statement handle.
\param psCursorName Pointer to a buffer in which to return the cursor name.
\param nBufferLength Size of pszCursorName.
- \param pnNameLengthPtr Pointer to memory in which to return the total number of
bytes available.
+ \param pnNameLength Pointer to memory in which to return the total number of
bytes available.
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLGetData.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetData.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetData.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -61,13 +61,13 @@
of the ARD. If it is SQL_C_DEFAULT, the driver selects the
default C data type based on the SQL data type of the source.
- \param pTargetValuePtr [Output]
+ \param pTargetValue [Output]
Pointer to the buffer in which to return the data.
\param nBufferLength [Input]
Length of the *pTargetValuePtr buffer in bytes.
- \param pStrLenOrPtr [Output]
+ \param pStrLenOrInd [Output]
Pointer to the buffer in which to return the length or
indicator value. If this is a null pointer, no length or
indicator value is returned. This returns an error when the
@@ -85,6 +85,8 @@
\sa SQLFetch
SQLExtendedFetch
SQLFetchScroll
+
+ \include tutorial_09.c
*/
SQLRETURN SQL_API SQLGetData( SQLHSTMT hStm,
SQLUSMALLINT nColumnNumber,
Modified: trunk/Driver/Driver/Library/SQLGetEnvAttr.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetEnvAttr.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetEnvAttr.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -36,9 +36,9 @@
\param hEnv Viable environment handle.
\param nAttribute Attribute to retrieve.
- \param pValuePtr Pointer to a buffer in which to return the attribute
value.
+ \param pValue Pointer to a buffer in which to return the attribute
value.
\param nBufferLength Size of pValuePtr buffer.
- \param pnStringLengthPtr Number of bytes available for pValuePtr.
+ \param pnStringLength Number of bytes available for pValuePtr.
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLGetFunctions.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetFunctions.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetFunctions.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -150,7 +150,7 @@
\param nFunctionID Specific function of interest or;
- SQL_API_ODBC3_ALL_FUNCTIONS
- SQL_API_ALL_FUNCTIONS
- \param pnSupportedPtr Pointer to SQLUSMALLINT (if one function queried) or
+ \param pnSupported Pointer to SQLUSMALLINT (if one function queried) or
array of SQL_API_ODBC3_ALL_FUNCTIONS_SIZE SQLUSMALLINT's
(if SQL_API_ODBC3_ALL_FUNCTIONS) or an array of
100 SQLUSMALLINT's (if SQL_API_ALL_FUNCTIONS).
Modified: trunk/Driver/Driver/Library/SQLGetInfoW.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetInfoW.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetInfoW.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -48,9 +48,9 @@
\param hDbc Viable connection handle.
\param nInfoType Type of information.
- \param pInfoValuePtr Pointer to a buffer in which to return the information.
+ \param pInfoValue Pointer to a buffer in which to return the information.
\param nBufferLength Size of pInfoValuePtr buffer.
- \param pnStringLengthPtr Number of bytes available for pInfoValuePtr.
+ \param pnStringLength Number of bytes available for pInfoValuePtr.
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLGetStmtOption.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLGetStmtOption.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLGetStmtOption.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -4,7 +4,7 @@
Copyright MySQL AB 2004-2006 Released under GPL.
\version Connector/ODBC v5
\date 2006
- \brief Contains the SQLGetStmtOptionW entry point.
+ \brief Contains the SQLGetStmtOption entry point.
\internal License
Copyright (C) 2000-2006 MySQL AB
@@ -29,6 +29,47 @@
*/
#include "MYODBCDriverInternal.h"
+/*!
+ \brief Get a statement option.
+
+ This function is used to get one of the following statement options;
+
+ - SQL_ASYNC_ENABLE
+ - SQL_BIND_TYPE
+ - SQL_CONCURRENCY
+ - SQL_CURSOR_TYPE
+ - SQL_GET_BOOKMARK
+ - SQL_KEYSET_SIZE
+ - SQL_MAX_LENGTH
+ - SQL_MAX_ROWS
+ - SQL_NOSCAN
+ - SQL_QUERY_TIMEOUT
+ - SQL_RETRIEVE_DATA
+ - SQL_ROW_NUMBER
+ - SQL_ROWSET_SIZE
+ - SQL_SIMULATE_CURSOR
+ - SQL_USE_BOOKMARKS
+
+ \deprecated This function has been deprecated in ODBC v3. Use \sa SQLGetStmtAttr
instead.
+ This function is implemented to support the following cases;
+
+ 1. An ODBC v1 or v2 application is being linked directly to the driver
(no DM to do mapping).
+ 2. In some cases the DM will prefer to defer ODBC version mapping to the
driver. This may
+ occur if the DM discovers that the driver is capable. The advantage to
the driver is that it
+ gains more control over the mapping.
+
+ \note This call is validated and then mapped to \sa SQLGetStmtAttr.
+
+ \param hStm A viable SQLHSTMT.
+ \param Option A viable statement option.
+ \param Value Reference to a place where the value may be returned. Must be
large enough to hold a 32-bit integer.
+
+ \return SQLRETURN
+
+ \retval SQL_SUCCESS
+ SQL_SUCCESS_WITH_INFO
+ SQL_INVALID_HANDLE
+*/
SQLRETURN SQL_API SQLGetStmtOption( SQLHSTMT hStm,
SQLUSMALLINT Option,
SQLPOINTER Value )
Modified: trunk/Driver/Driver/Library/SQLNumParams.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLNumParams.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLNumParams.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -14,7 +14,7 @@
Returns the number of parameter markers.
\param hStm Viable statement handle.
- \param pnParameterCountPtr Pointer to a buffer in which to return the number of
+ \param pnParameterCount Pointer to a buffer in which to return the number of
parameters in the statement.
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLParamData.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLParamData.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLParamData.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -36,7 +36,7 @@
data at statement execution time.
\param hStm Viable statement handle.
- \param ppValuePtrPtr
+ \param ppValue
\return SQLRETURN
Modified: trunk/Driver/Driver/Library/SQLRowCount.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLRowCount.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLRowCount.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -44,6 +44,8 @@
\retval SQL_STILL_EXECUTING Still executing from a previous call.
\retval SQL_ERROR Request failed.
\retval SQL_INVALID_HANDLE Invalid handle was provided.
+
+ \include tutorial_08.c
*/
SQLRETURN SQL_API SQLRowCount( SQLHSTMT hStm,
SQLINTEGER * pnRowCountPtr )
Modified: trunk/Driver/Driver/Library/SQLSetEnvAttr.cpp
===================================================================
--- trunk/Driver/Driver/Library/SQLSetEnvAttr.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/Library/SQLSetEnvAttr.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -40,6 +40,8 @@
\retval SQL_SUCCESS_WITH_INFO Request was probably processed ok - check diagnostic.
\retval SQL_ERROR Request failed.
\retval SQL_INVALID_HANDLE Invalid handle was provided.
+
+ \include tutorial_01.c
*/
SQLRETURN SQL_API SQLSetEnvAttr( SQLHENV hEnv,
SQLINTEGER nAttribute,
Modified: trunk/Driver/Driver/include/MYODBCDriver.h
===================================================================
--- trunk/Driver/Driver/include/MYODBCDriver.h 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/Driver/include/MYODBCDriver.h 2006-10-22 19:44:27 UTC (rev 609)
@@ -30,6 +30,18 @@
#ifndef MYODBC_DRV_H
#define MYODBC_DRV_H
+/*!
+ \example tutorial_01.c
+ \example tutorial_02.c
+ \example tutorial_03.c
+ \example tutorial_04.c
+ \example tutorial_05.c
+ \example tutorial_06.c
+ \example tutorial_07.c
+ \example tutorial_08.c
+ \example tutorial_09.c
+*/
+
/*
Put stuff like c/odbc specific;
Modified: trunk/Driver/User.doxygen
===================================================================
--- trunk/Driver/User.doxygen 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/User.doxygen 2006-10-22 19:44:27 UTC (rev 609)
@@ -497,7 +497,7 @@
# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH =
+EXAMPLE_PATH = ./examples/c
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
Added: trunk/Driver/examples/c/README.txt
===================================================================
--- trunk/Driver/examples/c/README.txt 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/README.txt 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,51 @@
+DRIVER EXAMPLES
+C Language
+---------------
+
+These examples are used for;
+
+ 1. tutorial
+ 2. doxygen based source code documentation (for examples)
+ 3. stand-alone examples
+
+The source files should be numbered in ascending order of difficulty
+in accordance with what the tutorial needs.
+
+The source files must NOT be nested in sub directories as doxygen
+does not support this.
+
+Tutorial
+--------
+
+The following files are used for a Tutorial. Some of these are also
+used for doxygen based code documentation.
+
+tutorial_01.c Allocate an environment handle, set desired ODBC version.
+tutorial_02.c Allocate a connection handle.
+tutorial_03.c Connect to a data source.
+tutorial_04.c Get diagnostic information.
+tutorial_05.c Allocate a statement.
+tutorial_06.c Submit a command to the data source.
+tutorial_07.c Get number of columns in result-set.
+tutorial_08.c Get number of rows in result-set.
+tutorial_09.c Get result-set data.
+
+Examples
+--------
+
+The following files compliment the Tutorial files.
+
+example_01.c Connect using SQLBrowseConnect.
+example_02.c Connection using SQLDriverConnect.
+example_04.c Get information about driver and data source.
+example_05.c Get information about data types supported.
+example_06.c Discover tables.
+example_07.c Discover table columns.
+example_08.c Discover table keys.
+example_09.c Discover table indexs.
+example_10.c Discover procedures.
+example_11.c Discover procedures columns.
+
+--
+Peter Harvey pharvey@stripped
+
Added: trunk/Driver/examples/c/tutorial_01.c
===================================================================
--- trunk/Driver/examples/c/tutorial_01.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_01.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,30 @@
+/*
+ Tutorial step 01.
+
+ In this step we provide an example of how to allocate an environment handle.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLRETURN nReturn;
+
+ /* Allocate the environment handle. */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ /*
+ Tell the Driver Manager and/or Driver that we are expecting ODBC v3 behaviour.
The default is ODBC v2 behaviour.
+
+ All new applications should set this to ODBC v3. This should be done before any
connections are allocated.
+ */
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+
+ /* We normally do stuff here but lets just exit. */
+
+ /* Free resources used by the handle. */
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_02.c
===================================================================
--- trunk/Driver/examples/c/tutorial_02.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_02.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,34 @@
+/*
+ Tutorial step 02.
+
+ In this step we provide an example of how to allocate a connection handle.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLRETURN nReturn;
+
+ /* init */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+
+ /*
+ Allocate a connection handle. A single environment may have 0 or more
connections.
+ */
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+
+ /* We normally do stuff here but lets just exit. */
+
+ /* Free resources used by the handle. */
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_03.c
===================================================================
--- trunk/Driver/examples/c/tutorial_03.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_03.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,37 @@
+/*
+ Tutorial step 03.
+
+ In this step we provide an example of how to connect to a data source.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1]; /* An existing DSN usually created by "ODBCConfig" or
"ODBC Administrator". */
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+
+ /* init */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+
+ /* Connect using an existing DSN. */
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+
+ /* We normally do stuff here but lets just exit. */
+
+ /* Disconnect. */
+ nReturn = SQLDisconnect( hDbc );
+
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_04.c
===================================================================
--- trunk/Driver/examples/c/tutorial_04.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_04.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,79 @@
+/*
+ Tutorial step 04.
+
+ In this step we provide an example of how to get diagnostic information.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+void dumpDiagnostics( SQLSMALLINT nHandleType, SQLHANDLE hHandle )
+{
+ SQLSMALLINT nRecord = 1;
+ SQLWCHAR sState[6];
+ SQLINTEGER nNativeError;
+ SQLWCHAR sMessageText[SQL_MAX_MESSAGE_LENGTH];
+ SQLSMALLINT nTextLength;
+
+ /*
+ The oldest diagnostic record will be 1. The driver is only obligated to
+ return up to 8 records but most will return more (as needed).
+
+ We loop through all records - printing them to stdout.
+
+ We use the SQL_SUCCEED macro to tell us if we have a SQL_SUCCESS
+ or SQL_SUCCESS_WITH_INFO. We expect to break out of loop when
+ SQLGetDiagRec returns SQL_NO_DATA.
+ */
+ while ( SQL_SUCCEEDED( SQLGetDiagRec( nHandleType,
+ hHandle,
+ nRecord,
+ sState,
+ &nNativeError,
+ sMessageText,
+ SQL_MAX_MESSAGE_LENGTH,
+ &nTextLength )) )
+ {
+ sState[5] = '\0';
+ printf( "[%s][%d] %s\n", sState, nNativeError, sMessageText );
+ nRecord++;
+ }
+}
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1]; /* An existing DSN usually created by "ODBCConfig" or
"ODBC Administrator". */
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+
+ /* init */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+
+ /* Check return code to see how things went for the last ODBC call. */
+ switch ( nReturn )
+ {
+ case SQL_ERROR:
+ dumpDiagnostics( SQL_HANDLE_DBC, hDbc );
+ goto exit1;
+ case SQL_SUCCESS_WITH_INFO:
+ dumpDiagnostics( SQL_HANDLE_DBC, hDbc );
+ break;
+ }
+
+ /* We normally do stuff here but lets just exit. */
+
+ nReturn = SQLDisconnect( hDbc );
+
+exit1:
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_05.c
===================================================================
--- trunk/Driver/examples/c/tutorial_05.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_05.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,42 @@
+/*
+ Tutorial step 05.
+
+ In this step we provide an example of how to allocate a statement handle.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLHSTMT hStm;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1];
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+
+ /* init */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+
+ /*
+ Allocate a statement handle. A single connection may have 0 or more statements.
+ */
+ nReturn = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt );
+
+ /* We normally do stuff here but lets just exit. */
+
+ /* Free resources used by the handle. */
+ nReturn = SQLFreeHandle( SQL_HANDLE_STMT, hStm );
+
+ /* fini */
+ nReturn = SQLDisconnect( hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_06.c
===================================================================
--- trunk/Driver/examples/c/tutorial_06.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_06.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,41 @@
+/*
+ Tutorial step 06.
+
+ In this step we provide an example of how to submit a command to the data source.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLHSTMT hStm;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1];
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+ SQLCHAR * pszCommand = "CREATE TABLE Tutorial AS " /
+ "( " /
+ " nID NUMERIC(6), " /
+ " vcData VARCHAR(50) " /
+ ") ";
+
+ /* init */
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+ nReturn = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt );
+
+ /* query */
+ nReturn = SQLExecDirect( hStmt, pszSQL, pszCommand, SQL_NTS );
+
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
+ nReturn = SQLDisconnect( hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/c/tutorial_07.c
===================================================================
--- trunk/Driver/examples/c/tutorial_07.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_07.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,59 @@
+/*
+ Tutorial step 07.
+
+ In this step we provide an example of how to get the number of columns.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLHSTMT hStm;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1];
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+ SQLCHAR * pszCommand = "INSERT INTO Tutorial ( nID, vcData ) " /
+ "VALUES ( 1, \"data 1\" ) ";
+ SQLSMALLINT nColumns = 0;
+ SQLINTEGER nRowsAffected = 0;
+
+ /* init */
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+ nReturn = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt );
+ nReturn = SQLExecDirect( hStmt, pszSQL, pszCommand, SQL_NTS );
+ if ( !SQL_SUCCEEDED( nReturn ) )
+ goto exit1;
+
+ /* we have some form of result */
+
+ /*
+ Get number of columns. A result may have a result-set (have data and there fore
have columns) or may be just row count/affected rows.
+ This makes checking for 0 columns a good way to see if there is a result-set to
process.
+ */
+ nReturn = SQLNumResultCols( hStm, &nColumns );
+ if ( nColumns > 0 )
+ {
+ /* we have a result-set */
+ }
+ else
+ {
+ /* no result-set - we can check for affect rows (should be 1 in this case) */
+ nReturn = SQLRowCount( hStm, nRowsAffected );
+ }
+
+exit1:
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
+ nReturn = SQLDisconnect( hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
+
Added: trunk/Driver/examples/c/tutorial_08.c
===================================================================
--- trunk/Driver/examples/c/tutorial_08.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_08.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,57 @@
+/*
+ Tutorial step 08.
+
+ In this step we provide an example of how to get the row count.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLHSTMT hStm;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1];
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+ SQLCHAR * pszCommand = "SELECT * " /
+ "FROM Tutorial";
+ SQLSMALLINT nColumns = 0;
+
+ /* init */
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+ nReturn = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt );
+ nReturn = SQLExecDirect( hStmt, pszSQL, pszCommand, SQL_NTS );
+ if ( !SQL_SUCCEEDED( nReturn ) )
+ goto exit1;
+
+ /* we have some form of result */
+
+ /*
+ Get number of columns. A result may have a result-set (have data and there fore
have columns) or may be just row count/affected rows.
+ This makes checking for 0 columns a good way to see if there is a result-set to
process.
+ */
+ nReturn = SQLNumResultCols( hStm, &nColumns );
+ if ( nColumns > 0 )
+ {
+ /* we have a result-set */
+ }
+ else
+ {
+ /* no result-set - we can check for affect rows (should be 1 in this case) */
+ }
+
+exit1:
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
+ nReturn = SQLDisconnect( hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
+
Added: trunk/Driver/examples/c/tutorial_09.c
===================================================================
--- trunk/Driver/examples/c/tutorial_09.c 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/c/tutorial_09.c 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,61 @@
+/*
+ Tutorial step 09.
+
+ In this step we provide an example of how to get data.
+*/
+#include <sql.h>
+#include <sqlext.h>
+
+#define DATA_MAX 255
+
+int main( int argc, char *argv[] )
+{
+ SQLHENV hEnv;
+ SQLHDBC hDbc;
+ SQLHSTMT hStm;
+ SQLRETURN nReturn;
+ SQLCHAR * pszDSN = argv[1];
+ SQLCHAR * pszUID = argv[2];
+ SQLCHAR * pszPWD = argv[3];
+ SQLCHAR * pszCommand = "SELECT * " /
+ "FROM Tutorial";
+ SQLCHAR szData[DATA_MAX + 1];
+ SQLINTEGER nDataInd;
+ SQLINTEGER nID;
+ SQLINTEGER nIDInd;
+
+ /* init */
+ nReturn = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv );
+ nReturn = SQLSetEnvAttr( hEnv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 );
+ nReturn = SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc );
+ nReturn = SQLConnect( hDbc, pszDSN, SQL_NTS, pszUID, SQL_NTS, pszPWD, SQL_NTS );
+ nReturn = SQLAllocHandle( SQL_HANDLE_STMT, hDbc, hStmt );
+ nReturn = SQLExecDirect( hStmt, pszSQL, pszCommand, SQL_NTS );
+ if ( !SQL_SUCCEEDED( nReturn ) )
+ goto exit1;
+
+ /* fetch data */
+ while ( 1 )
+ {
+ nReturn = SQLFetch( hStmt );
+ if ( !SQL_SUCCEEDED( nReturn ) )
+ break;
+ nReturn = SQLGetData( hStmt, 1, SQL_C_LONG, nID, SQL_IS_INTEGER, &nIDInd );
+ nReturn = SQLGetData( hStmt, 2, SQL_C_CHAR, szData, DATA_MAX, &nDataInd );
+ if ( nIDInd == SQL_NULL_DATA )
+ printf( "NULL" );
+ else
+ printf( "%ld", nIDInd );
+ printf( " %s\n", ( nDataInd == SQL_NULL_DATA ? "NULL" : szData ) );
+ }
+
+exit1:
+ /* fini */
+ nReturn = SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
+ nReturn = SQLDisconnect( hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_DBC, hDbc );
+ nReturn = SQLFreeHandle( SQL_HANDLE_ENV, hEnv );
+
+ return( 0 );
+}
+
Added: trunk/Driver/examples/cpp/ADO/5.gif
===================================================================
(Binary files differ)
Property changes on: trunk/Driver/examples/cpp/ADO/5.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Driver/examples/cpp/ADO/ADO.pro
===================================================================
--- trunk/Driver/examples/cpp/ADO/ADO.pro 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/cpp/ADO/ADO.pro 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,32 @@
+# #########################################################
+#
+# \brief
+#
+# #########################################################
+
+# #########################################################
+# COMMON
+# #########################################################
+TEMPLATE = app
+TARGET = ADO
+DESTDIR = ./
+CONFIG += console
+include( ../common.pri )
+include( ../config.pri )
+include( ../defines.pri )
+include( ../odbc.pri )
+
+# #########################################################
+# WIN
+# #########################################################
+win32 {
+ LIBS += user32.lib
+}
+
+# #########################################################
+# FILES
+# #########################################################
+HEADERS =
+SOURCES = \
+ main.cpp
+
Added: trunk/Driver/examples/cpp/ADO/main.cpp
===================================================================
--- trunk/Driver/examples/cpp/ADO/main.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/cpp/ADO/main.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,555 @@
+/*!
+ \file main.cpp
+ \author Peter Harvey <pharvey@stripped>
+ Copyright MySQL AB 2004-2006 Released under GPL.
+ \version Connector/ODBC v5
+ \date 2006
+ \brief Demonstrates ADO in use via C++.
+
+ It is probably safe to say that ADO is seldom used via C++ while ADO is
often used by
+ Visual Basic. The result is that it can sometimes be very difficult to
find information
+ on how to do some things with ADO in C++. For example; sending binary
'down the pipe'
+ via CreateParameter.
+
+ This file has been created in the hope that it may answer questions by
those wishing
+ to 'go down this path'.
+
+ \note Before using this code you will want to;
+ - create the tbAdo table (see code comments later in this file)
+ - create the insAdo stored procedure (see code comments later in this
file)
+ - create a DSN (to tbAdo and insAdo) - for MyODBC you may want to use
following options;
+ - allow big results
+ - use compressed protocol
+ - alter the connection information in the code below
+ - BINARY_FILENAME must exist in current dir when prg exec
+
+ \warning Do not use this in a production environment or in any environment where
you may suffer
+ grief if things go horribly wrong (or even a little wrong). Use at your
own risk.
+*/
+#include <oledb.h>
+#include <msdadc.h>
+#include <msdaguid.h>
+
+#include <ole2.h>
+#include <stdio.h>
+#include <io.h>
+#include <fcntl.h>
+#include <sys\stat.h>
+
+/*!
+ \note
+
+ Import ADO.
+
+ We can avoid using the full path if LIBPATH environment variable includes
+ the path to msado<VERSION>.dll.
+*/
+/*
+#import "msado15.dll" \
+ no_namespace rename("EOF", "EndOfFile")
+*/
+#import "C:\Program Files\Common Files\System\ado\msado15.dll" \
+ no_namespace \
+ rename( "EOF", "EndOfFile")
+
+// handle a HRESULT return type
+inline void TESTHR( HRESULT x ) { if FAILED(x) _com_issue_error(x); };
+
+// global connect
+_ConnectionPtr pConnection = NULL;
+char *pszConnectionString = "YourDataSourceName";
+char *pszUserID = "YourUserIdentifier";
+char *pszPassword = "YourPassword";
+
+// sample data
+UCHAR pDataText[] = "12345678901234567890123456789012345678901234567890";
+int nDataLengthText = 10; // data truncation errors if this is larger than strlen
pDataText or size of column
+
+#define BINARY_FILENAME "5.gif"
+UCHAR * pDataBinary = NULL;
+long nDataLengthBinary = 0;
+
+/*!
+ \brief Print the providers errors.
+*/
+void doPrintProviderError( const char *pszFileName, int nLine, const char *pszFunction,
_ConnectionPtr pConnection )
+{
+ ErrorPtr pErr = NULL;
+
+ // do we have errors?
+ if ( pConnection->Errors->Count > 0 )
+ {
+ long nCount = pConnection->Errors->Count;
+
+ // for each error - print error
+ for ( long n = 0; n < nCount; n++ )
+ {
+ pErr = pConnection->Errors->GetItem( n );
+ printf( "[%s][%d][%s] ERROR: %x\t%s\n", pszFileName, nLine, pszFunction,
pErr->Number, (LPCSTR)pErr->Description );
+ }
+ }
+}
+
+/*!
+ \brief Print COM error.
+*/
+void doPrintComError( const char *pszFileName, int nLine, const char *pszFunction,
_com_error &e )
+{
+ _bstr_t bstrSource( e.Source() );
+ _bstr_t bstrDescription( e.Description() );
+
+ printf( "[%s][%d][%s] ERROR:\n", pszFileName, nLine, pszFunction );
+ printf( "\tCode = %08lx\n", e.Error() );
+ wprintf( L"\tCode meaning = %s\n", e.ErrorMessage() );
+ printf( "\tSource = %s\n", (LPCSTR)bstrSource );
+ printf( "\tDescription = %s\n", (LPCSTR)bstrDescription );
+}
+
+/*!
+ \brief Print record-set.
+
+ This prints all data in the record-set in a generic fashion.
+*/
+bool doPrintRecordset( _RecordsetPtr pRecordset )
+{
+ /* field names */
+ for ( long nField = 0; nField < pRecordset->Fields->Count; nField++ )
+ {
+ if ( !nField )
+ printf( "|" );
+ printf( "%s %d |", (LPCSTR)(pRecordset->Fields->GetItem( nField
)->Name), pRecordset->Fields->Item[nField]->Type );
+ }
+ printf( "\n" );
+
+ /* rows */
+ while ( !pRecordset->EndOfFile )
+ {
+ wprintf( pRecordset->GetString( adClipString, 1, "|", "\n", "<NULL>" )
);
+// pRecordset->MoveNext();
+ }
+
+ return true;
+}
+
+/*!
+ \brief Connect.
+
+ This will connect to the data source.
+*/
+bool doConnect()
+{
+ try
+ {
+ TESTHR( pConnection.CreateInstance( __uuidof( Connection ) ) );
+ pConnection->Open( pszConnectionString, pszUserID, pszPassword,
adConnectUnspecified );
+ printf( "[%s][%d] state: %d\n", __FILE__, __LINE__, pConnection->State );
+ }
+ catch ( _com_error &e )
+ {
+ doPrintProviderError( __FILE__, __LINE__, __FUNCTION__, pConnection );
+ doPrintComError( __FILE__, __LINE__, __FUNCTION__, e );
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ \brief Print all data in tbAdo.
+*/
+bool doSelect()
+{
+ _CommandPtr pCommand = NULL;
+ _ParameterPtr pParameter = NULL;
+ _RecordsetPtr pRecordset = NULL;
+
+ try
+ {
+ TESTHR( pCommand.CreateInstance( __uuidof( Command ) ) );
+ pCommand->ActiveConnection = pConnection;
+ pCommand->CommandText = "SELECT * FROM tbAdo";
+ pCommand->CommandType = adCmdText;
+
+ pRecordset = pCommand->Execute( NULL, NULL, adCmdText );
+
+ doPrintRecordset( pRecordset );
+ }
+ catch ( _com_error &e )
+ {
+ doPrintProviderError( __FILE__, __LINE__, __FUNCTION__, pConnection );
+ doPrintComError( __FILE__, __LINE__, __FUNCTION__, e );
+ return false;
+ }
+
+
+ return true;
+}
+
+/*!
+ \brief Use CreateParameter on an INSERT statement.
+
+ This will show CreateParameter in use on an INSERT statement
+ with a variety of column data types.
+
+ \note Needs the following table to work...
+
+ MSSQL
+ -----
+ CREATE TABLE `tbAdo`
+ (
+ `bin` VARBINARY(1024),
+ `txt` TEXT,
+ `n` INTEGER,
+ `vc` VARCHAR(50)
+ )
+
+ MySQL
+ -----
+ CREATE TABLE `tbAdo`
+ (
+ `bin` VARBINARY(1024),
+ `txt` TEXT,
+ `n` INTEGER UNSIGNED,
+ `vc` VARCHAR(50)
+ )
+ ENGINE = InnoDB;
+*/
+bool doCreateParameterInsert()
+{
+ _CommandPtr pCommand = NULL;
+ _ParameterPtr pParameter = NULL;
+ VARIANT variant1;
+ VARIANT variant2;
+ VARIANT variant3;
+ VARIANT variant4;
+
+ SAFEARRAY FAR * pArrayBinary;
+ SAFEARRAYBOUND arrayBoundBinary[1];
+
+ SAFEARRAY FAR * pArrayText;
+ SAFEARRAYBOUND arrayBoundText[1];
+
+ try
+ {
+ // our INSERT statement
+ TESTHR( pCommand.CreateInstance( __uuidof( Command ) ) );
+ pCommand->ActiveConnection = pConnection;
+ pCommand->CommandText = "INSERT INTO tbAdo VALUES( ?, ?, ?, ? )";
+ pCommand->CommandType = adCmdText;
+
+ // BINARY
+ {
+ // init a SAFEARRAY
+ void *pSafeArrayDataRef = NULL;
+
+ arrayBoundBinary[0].lLbound = 0;
+ arrayBoundBinary[0].cElements = nDataLengthBinary;
+
+ pArrayBinary = SafeArrayCreate( VT_UI1, 1, arrayBoundBinary );
+
+ SafeArrayAccessData( pArrayBinary, &pSafeArrayDataRef );
+ memcpy( pSafeArrayDataRef, pDataBinary, nDataLengthBinary );
+ SafeArrayUnaccessData( pArrayBinary );
+
+ // init VARIANT with our safearray
+ variant1.vt = VT_ARRAY|VT_UI1;
+ variant1.parray = pArrayBinary;
+
+ // init bound parameter with our variant
+ pParameter = pCommand->CreateParameter( "bin", adBinary,
adParamInput, nDataLengthBinary, variant1 );
+ pCommand->Parameters->Append( pParameter );
+ }
+
+ // TEXT
+ {
+ // init a SAFEARRAY
+ void *pSafeArrayDataRef = NULL;
+
+ arrayBoundText[0].lLbound = 0;
+ arrayBoundText[0].cElements = nDataLengthText;
+
+ pArrayText = SafeArrayCreate( VT_UI1, 1, arrayBoundText );
+
+ SafeArrayAccessData( pArrayText, &pSafeArrayDataRef );
+ memcpy( pSafeArrayDataRef, pDataText, nDataLengthText );
+ SafeArrayUnaccessData( pArrayText );
+
+ // init VARIANT with our safearray
+ variant2.vt = VT_ARRAY|VT_UI1;
+ variant2.parray = pArrayText;
+
+ // init bound parameter with our variant
+ pParameter = pCommand->CreateParameter( "txt", adLongVarChar,
adParamInput, nDataLengthText, variant2 );
+ pCommand->Parameters->Append( pParameter );
+ }
+
+ // INTEGER
+ variant3.vt = VT_I2;
+ variant3.iVal = 1867;
+ pParameter = pCommand->CreateParameter( "n", adInteger, adParamInput,
sizeof(int), variant3 );
+ pCommand->Parameters->Append( pParameter );
+
+ // VARCHAR
+ variant4.vt = VT_BSTR;
+ variant4.bstrVal = _bstr_t( "test" );
+ pParameter = pCommand->CreateParameter( "vc", adChar, adParamInput, 5,
variant4 );
+ pCommand->Parameters->Append( pParameter );
+
+ // execute statement
+ pCommand->Execute( NULL, NULL, adCmdText );
+
+// SafeArrayDestroy( variant4 );
+ }
+ catch ( _com_error &e )
+ {
+ doPrintProviderError( __FILE__, __LINE__, __FUNCTION__, pConnection );
+ doPrintComError( __FILE__, __LINE__, __FUNCTION__, e );
+ return false;
+ }
+
+
+ return true;
+}
+
+/*!
+ \brief Use CreateParameter on a stored procedure.
+
+ This shows CreateParameter in use on a stored procedure with a variety of
+ column data types.
+
+ \note This needs the following stored procedure to work...
+
+ MSSQL
+ ------
+ CREATE PROCEDURE insAdo @bin VARBINARY(1024), @txt TEXT, @n INT, @vc
VARCHAR(50) AS
+ INSERT INTO tbAdo VALUES( @bin, @txt, @n, @vc )
+
+ MySQL
+ -----
+ CREATE PROCEDURE `northwind`.`insAdo` ( IN bin VARBINARY(1024), IN txt TEXT,
IN n INT, IN vc VARCHAR(50) )
+ BEGIN
+ INSERT INTO tbAdo VALUES( @bin, @txt, @n, @vc );
+ END
+
+*/
+bool doCreateParameterProcedure()
+{
+ _CommandPtr pCommand = NULL;
+ _ParameterPtr pParameter = NULL;
+ VARIANT variant1;
+ VARIANT variant2;
+ VARIANT variant3;
+ VARIANT variant4;
+
+ SAFEARRAY FAR * pArrayBinary;
+ SAFEARRAYBOUND arrayBoundBinary[1];
+
+ SAFEARRAY FAR * pArrayText;
+ SAFEARRAYBOUND arrayBoundText[1];
+
+ try
+ {
+ // our stored procedure statement
+ TESTHR( pCommand.CreateInstance( __uuidof( Command ) ) );
+ pCommand->ActiveConnection = pConnection;
+ pCommand->CommandText = "insAdo";
+ pCommand->CommandType = adCmdStoredProc;
+
+ // BINARY
+ {
+ // init a SAFEARRAY
+ void *pSafeArrayDataRef = NULL;
+
+ arrayBoundBinary[0].lLbound = 0;
+ arrayBoundBinary[0].cElements = nDataLengthBinary;
+
+ pArrayBinary = SafeArrayCreate( VT_UI1, 1, arrayBoundBinary );
+
+ SafeArrayAccessData( pArrayBinary, &pSafeArrayDataRef );
+ memcpy( pSafeArrayDataRef, pDataBinary, nDataLengthBinary );
+ SafeArrayUnaccessData( pArrayBinary );
+
+ // init VARIANT with our safearray
+ variant1.vt = VT_ARRAY|VT_UI1;
+ variant1.parray = pArrayBinary;
+
+ // init bound parameter with our variant
+ pParameter = pCommand->CreateParameter( "bin", adBinary,
adParamInput, nDataLengthBinary, variant1 );
+ pCommand->Parameters->Append( pParameter );
+ }
+
+ // TEXT
+ {
+ // init a SAFEARRAY
+ void *pSafeArrayDataRef = NULL;
+
+ arrayBoundText[0].lLbound = 0;
+ arrayBoundText[0].cElements = nDataLengthText;
+
+ pArrayText = SafeArrayCreate( VT_UI1, 1, arrayBoundText );
+
+ SafeArrayAccessData( pArrayText, &pSafeArrayDataRef );
+ memcpy( pSafeArrayDataRef, pDataText, nDataLengthText );
+ SafeArrayUnaccessData( pArrayText );
+
+ // init VARIANT with our safearray
+ variant2.vt = VT_ARRAY|VT_UI1;
+ variant2.parray = pArrayBinary;
+
+ // init bound parameter with our variant
+ pParameter = pCommand->CreateParameter( "txt", adChar, adParamInput,
nDataLengthText, variant2 );
+ pCommand->Parameters->Append( pParameter );
+ }
+
+ // INTEGER
+ variant3.vt = VT_I2;
+ variant3.iVal = 1867;
+ pParameter = pCommand->CreateParameter( "n", adInteger, adParamInput,
sizeof(int), variant3 );
+ pCommand->Parameters->Append( pParameter );
+
+ // VARCHAR
+ variant4.vt = VT_BSTR;
+ variant4.bstrVal = _bstr_t( "test" );
+ pParameter = pCommand->CreateParameter( "vc", adChar, adParamInput, 5,
variant4 );
+ pCommand->Parameters->Append( pParameter );
+
+ // execute statement
+ pCommand->Execute( NULL, NULL, adCmdStoredProc );
+
+// SafeArrayDestroy( variant4 );
+ }
+ catch ( _com_error &e )
+ {
+ doPrintProviderError( __FILE__, __LINE__, __FUNCTION__, pConnection );
+ doPrintComError( __FILE__, __LINE__, __FUNCTION__, e );
+ return false;
+ }
+
+ return true;
+}
+
+
+/*!
+ \brief Disconnect.
+
+ This will disconnect from the data source.
+*/
+bool doDisconnect()
+{
+ try
+ {
+ pConnection->Close();
+ printf( "[%s][%d] state: %d\n", __FILE__, __LINE__, pConnection->State );
+ }
+ catch ( _com_error &e )
+ {
+ doPrintProviderError( __FILE__, __LINE__, __FUNCTION__, pConnection );
+ doPrintComError( __FILE__, __LINE__, __FUNCTION__, e );
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ \brief Loads a file into memory.
+
+ Loads contents of file (pszFileName) into buffer (ppData).
+
+ \note
+ This takes care of allocating buffer at ppData but caller must
+ free it when done.
+
+ \param pszFileName File to be loaded. It must exist.
+ \param ppData Place to return the pointer to the file data.
+ \param pnDataLength Place to return the number of bytes loaded from the
+ file. The buffer size at ppData may be this size OR
+ larger.
+
+ \return bool
+
+ \retval false Something went wrong. Error message was sent to stdout.
+ \retval true Success.
+*/
+bool doLoadFile( const char *pszFileName, UCHAR **ppData, long *pnDataLength )
+{
+ bool bReturn = false;
+
+ int nFile = open( pszFileName, _O_RDONLY, _S_IREAD );
+ if ( nFile == -1 )
+ {
+ printf( "[%s][%d][%s] ERROR: Failed to open (%s)\n", __FILE__, __LINE__,
__FUNCTION__, pszFileName );
+ return false;
+ }
+
+ *pnDataLength = _filelength( nFile );
+ if ( *pnDataLength < 1 )
+ {
+ printf( "[%s][%d][%s] ERROR: Failed to get file length for (%s)\n", __FILE__,
__LINE__, __FUNCTION__, pszFileName );
+ goto doLoadFileExit1;
+ }
+
+ *ppData = (UCHAR*)malloc( *pnDataLength );
+ if ( *ppData == NULL )
+ {
+ printf( "[%s][%d][%s] ERROR: Failed to malloc %ld bytes\n", __FILE__, __LINE__,
__FUNCTION__, *pnDataLength );
+ goto doLoadFileExit2;
+ }
+
+ int nReadTotal = 0;
+ int nRead = 0;
+ do
+ {
+ nRead = read( nFile, *ppData, *pnDataLength );
+ nReadTotal += nRead;
+ } while ( nRead );
+
+ if ( (long)nReadTotal != *pnDataLength )
+ printf( "[%s][%d][%s] INFO: Allocated %ld and read %d into it.\n", __FILE__,
__LINE__, __FUNCTION__, *pnDataLength, nReadTotal );
+
+ bReturn = true;
+ goto doLoadFileExit1;
+
+doLoadFileExit2:
+ free( *ppData );
+
+doLoadFileExit1:
+ close( nFile );
+
+ return bReturn;
+}
+
+/*!
+ \brief main
+
+ This is the 'main' entry point to this program - it all starts here.
+
+ \todo We need to do a better job of cleaning up after our processing.
+*/
+void main()
+{
+ /*!
+ \note
+ */
+ if ( FAILED( ::CoInitialize( NULL ) ) )
+ return;
+
+ /* get some example binary data */
+ if ( !doLoadFile( BINARY_FILENAME, &pDataBinary, &nDataLengthBinary ) )
+ return;
+
+ /* do it */
+ if ( doConnect() )
+ {
+ doCreateParameterInsert();
+ doCreateParameterProcedure();
+ doSelect();
+ doDisconnect();
+ }
+
+ /*!
+ \note
+ */
+ ::CoUninitialize();
+}
+
Added: trunk/Driver/examples/vb/7/AssemblyInfo.vb
===================================================================
--- trunk/Driver/examples/vb/7/AssemblyInfo.vb 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/vb/7/AssemblyInfo.vb 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,32 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("")>
+<Assembly: AssemblyCopyright("")>
+<Assembly: AssemblyTrademark("")>
+<Assembly: CLSCompliant(True)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("CDF1103D-EA12-43B4-B52D-0D72DFD2AE27")>
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+
+<Assembly: AssemblyVersion("1.0.*")>
Added: trunk/Driver/examples/vb/7/Module1.vb
===================================================================
--- trunk/Driver/examples/vb/7/Module1.vb 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/vb/7/Module1.vb 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,88 @@
+Module Module1
+
+ Sub Main()
+ On Error GoTo ErrorHandler
+
+ 'recordset, command and connection variables
+ Dim Cnxn As ADODB.Connection
+ Dim cmdByRoyalty As ADODB.Command
+ Dim prmByRoyalty As ADODB.Parameter
+ Dim rstByRoyalty As ADODB.Recordset
+ Dim rstAuthors As ADODB.Recordset
+ Dim strCnxn As String
+ Dim strSQLAuthors As String
+ Dim strSQLByRoyalty As String
+ 'record variables
+ Dim intRoyalty As Integer
+ Dim strAuthorID As String
+
+ ' Open connection
+ Cnxn = New ADODB.Connection
+ strCnxn = "Provider='odbc';Data Source='NorthwindMySQL';" & "Initial
Catalog='Northwind';"
+ Cnxn.Open(strCnxn)
+
+ ' Open command object with one parameter
+ cmdByRoyalty = New ADODB.Command
+ cmdByRoyalty.CommandText = "byroyalty"
+ cmdByRoyalty.CommandType = adCmdStoredProc
+
+ ' Get parameter value and append parameter
+ intRoyalty = Trim(InputBox("Enter royalty:"))
+ prmByRoyalty = cmdByRoyalty.CreateParameter("percentage", adInteger,
adParamInput)
+ cmdByRoyalty.Parameters.Append(prmByRoyalty)
+ prmByRoyalty.Value = intRoyalty
+
+ ' Create recordset by executing the command
+ cmdByRoyalty.ActiveConnection = Cnxn
+ rstByRoyalty = cmdByRoyalty.Execute
+
+ ' Open the Authors Table to get author names for display
+ ' and set cursor client-side
+ rstAuthors = New ADODB.Recordset
+ strSQLAuthors = "Authors"
+ rstAuthors.Open(strSQLAuthors, Cnxn, adUseClient, adLockOptimistic, adCmdTable)
+
+ ' Print recordset adding author names from Authors table
+ Debug.Print("Authors with " & intRoyalty & " percent royalty")
+
+ Do Until rstByRoyalty.EOF
+ strAuthorID = rstByRoyalty!au_id
+ Debug.Print " " & rstByRoyalty!au_id & ", ";
+ rstAuthors.Filter = "au_id = '" & strAuthorID & "'"
+ Debug.Print(rstAuthors!au_fname & " " & rstAuthors!au_lname)
+ rstByRoyalty.MoveNext()
+ Loop
+
+ ' clean up
+ rstByRoyalty.Close()
+ rstAuthors.Close()
+ Cnxn.Close()
+ rstByRoyalty = Nothing
+ rstAuthors = Nothing
+ Cnxn = Nothing
+ Exit Sub
+
+ErrorHandler:
+ ' clean up
+ If Not rstByRoyalty Is Nothing Then
+ If rstByRoyalty.State = adStateOpen Then rstByRoyalty.Close()
+ End If
+ rstByRoyalty = Nothing
+
+ If Not rstAuthors Is Nothing Then
+ If rstAuthors.State = adStateOpen Then rstAuthors.Close()
+ End If
+ rstAuthors = Nothing
+
+ If Not Cnxn Is Nothing Then
+ If Cnxn.State = adStateOpen Then Cnxn.Close()
+ End If
+ Cnxn = Nothing
+
+ If Err() <> 0 Then
+ MsgBox(Err.Source & "-->" & Err.Description, , "Error")
+ End If
+
+ End Sub
+
+End Module
Added: trunk/Driver/examples/vb/7/VB-ADO.sln
===================================================================
--- trunk/Driver/examples/vb/7/VB-ADO.sln 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/vb/7/VB-ADO.sln 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VB-ADO", "VB-ADO.vbproj",
"{230F1888-1860-4677-AB0E-C3414292045A}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {230F1888-1860-4677-AB0E-C3414292045A}.Debug.ActiveCfg = Debug|.NET
+ {230F1888-1860-4677-AB0E-C3414292045A}.Debug.Build.0 = Debug|.NET
+ {230F1888-1860-4677-AB0E-C3414292045A}.Release.ActiveCfg = Release|.NET
+ {230F1888-1860-4677-AB0E-C3414292045A}.Release.Build.0 = Release|.NET
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
Added: trunk/Driver/examples/vb/7/VB-ADO.suo
===================================================================
(Binary files differ)
Property changes on: trunk/Driver/examples/vb/7/VB-ADO.suo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/Driver/examples/vb/7/VB-ADO.vbproj
===================================================================
--- trunk/Driver/examples/vb/7/VB-ADO.vbproj 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/Driver/examples/vb/7/VB-ADO.vbproj 2006-10-22 19:44:27 UTC (rev 609)
@@ -0,0 +1,103 @@
+<VisualStudioProject>
+ <VisualBasic
+ ProjectType = "Local"
+ ProductVersion = "7.10.3077"
+ SchemaVersion = "2.0"
+ ProjectGuid = "{230F1888-1860-4677-AB0E-C3414292045A}"
+ >
+ <Build>
+ <Settings
+ ApplicationIcon = ""
+ AssemblyKeyContainerName = ""
+ AssemblyName = "VB-ADO"
+ AssemblyOriginatorKeyFile = ""
+ AssemblyOriginatorKeyMode = "None"
+ DefaultClientScript = "JScript"
+ DefaultHTMLPageLayout = "Grid"
+ DefaultTargetSchema = "IE50"
+ DelaySign = "false"
+ OutputType = "Exe"
+ OptionCompare = "Binary"
+ OptionExplicit = "On"
+ OptionStrict = "Off"
+ RootNamespace = "VB_ADO"
+ StartupObject = "VB_ADO.Module1"
+ >
+ <Config
+ Name = "Debug"
+ BaseAddress = "285212672"
+ ConfigurationOverrideFile = ""
+ DefineConstants = ""
+ DefineDebug = "true"
+ DefineTrace = "true"
+ DebugSymbols = "true"
+ IncrementalBuild = "true"
+ Optimize = "false"
+ OutputPath = "bin\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "1"
+ />
+ <Config
+ Name = "Release"
+ BaseAddress = "285212672"
+ ConfigurationOverrideFile = ""
+ DefineConstants = ""
+ DefineDebug = "false"
+ DefineTrace = "true"
+ DebugSymbols = "false"
+ IncrementalBuild = "false"
+ Optimize = "true"
+ OutputPath = "bin\"
+ RegisterForComInterop = "false"
+ RemoveIntegerChecks = "false"
+ TreatWarningsAsErrors = "false"
+ WarningLevel = "1"
+ />
+ </Settings>
+ <References>
+ <Reference
+ Name = "System"
+ AssemblyName = "System"
+ />
+ <Reference
+ Name = "System.Data"
+ AssemblyName = "System.Data"
+ />
+ <Reference
+ Name = "System.XML"
+ AssemblyName = "System.Xml"
+ />
+ <Reference
+ Name = "adodb"
+ AssemblyName = "adodb"
+ HintPath = "..\..\..\..\..\..\..\..\..\Program
Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll"
+ AssemblyFolderKey = "hklm\primary interop assemblies"
+ />
+ </References>
+ <Imports>
+ <Import Namespace = "Microsoft.VisualBasic" />
+ <Import Namespace = "System" />
+ <Import Namespace = "System.Collections" />
+ <Import Namespace = "System.Data" />
+ <Import Namespace = "System.Diagnostics" />
+ </Imports>
+ </Build>
+ <Files>
+ <Include>
+ <File
+ RelPath = "AssemblyInfo.vb"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Module1.vb"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ </Include>
+ </Files>
+ </VisualBasic>
+</VisualStudioProject>
+
Modified: trunk/SDK/MYSQLPlus/Library/MEnvironment.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MEnvironment.cpp 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/SDK/MYSQLPlus/Library/MEnvironment.cpp 2006-10-22 19:44:27 UTC (rev 609)
@@ -1,3 +1,32 @@
+/*!
+ \file MEnvironment.cpp
+ \author Peter Harvey <pharvey@stripped>
+ Copyright MySQL AB 2004-2006 Released under GPL.
+ \version Connector/ODBC v5
+ \date 2006
+ \brief Contains the MEnvironment class definition.
+ \internal License
+
+ Copyright (C) 2000-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ There are special exceptions to the terms and conditions of the GPL as it
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS in the directory of this software distribution.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
#include "MInternal.h"
/*!
Modified: trunk/SDK/MYSQLPlus/User.doxygen
===================================================================
--- trunk/SDK/MYSQLPlus/User.doxygen 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/SDK/MYSQLPlus/User.doxygen 2006-10-22 19:44:27 UTC (rev 609)
@@ -217,28 +217,28 @@
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
-HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_MEMBERS = YES
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
-HIDE_UNDOC_CLASSES = NO
+HIDE_UNDOC_CLASSES = YES
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
-HIDE_FRIEND_COMPOUNDS = NO
+HIDE_FRIEND_COMPOUNDS = YES
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
# documentation blocks found inside the body of a function.
# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
-HIDE_IN_BODY_DOCS = NO
+HIDE_IN_BODY_DOCS = YES
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
Modified: trunk/SDK/MYSQLPlus/include/MEnvironment.h
===================================================================
--- trunk/SDK/MYSQLPlus/include/MEnvironment.h 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/SDK/MYSQLPlus/include/MEnvironment.h 2006-10-22 19:44:27 UTC (rev 609)
@@ -1,3 +1,32 @@
+/*!
+ \file MEnvironment.h
+ \author Peter Harvey <pharvey@stripped>
+ Copyright MySQL AB 2004-2006 Released under GPL.
+ \version Connector/ODBC v5
+ \date 2006
+ \brief Contains the MEnvironment class declaration.
+ \internal License
+
+ Copyright (C) 2000-2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ There are special exceptions to the terms and conditions of the GPL as it
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS in the directory of this software distribution.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
#ifndef MENVIRONMENT_H
#define MENVIRONMENT_H
@@ -3,4 +32,10 @@
#include "M.h"
+/*!
+ \brief A MYSQLPlus Environment.
+
+ The Environment is typically the first class to be instantiated. An
application
+ creates an instance of MEnvironment and then one or more MConnection's.
+*/
class MEnvironment : public QObject
{
Modified: trunk/connector-odbc.vpj
===================================================================
--- trunk/connector-odbc.vpj 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/connector-odbc.vpj 2006-10-22 19:44:27 UTC (rev 609)
@@ -52,6 +52,7 @@
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl">
+ <F N="doc/Header.html"/>
<F N="License.html"/>
</Folder>
<Folder
Modified: trunk/connector-odbc.vpw
===================================================================
--- trunk/connector-odbc.vpw 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/connector-odbc.vpw 2006-10-22 19:44:27 UTC (rev 609)
@@ -12,6 +12,7 @@
<Project File="Driver/Driver/Driver.vpj" />
<Project File="Driver/Driver/Library/DriverLibrary.vpj" />
<Project File="Driver/Driver/Tests/DriverTests.vpj" />
+ <Project File="Driver/examples/c/examples-c.vpj" />
<Project File="SDK/Installer/Ins.vpj" />
<Project File="SDK/Installer/Library/InsLibrary.vpj" />
<Project File="Tools/Installer/Installer.vpj" />
Modified: trunk/doc/Header.html
===================================================================
--- trunk/doc/Header.html 2006-10-20 11:43:59 UTC (rev 608)
+++ trunk/doc/Header.html 2006-10-22 19:44:27 UTC (rev 609)
@@ -1,4 +1,8 @@
<html>
+<head>
+ <link href="doxygen.css" rel="stylesheet" type=text/css">
+ </link>
+</head>
<body>
<table bgcolor="orange" width=100%>
<tr>
| Thread |
|---|
| • Connector/ODBC 5 commit: r609 - in trunk: . Driver Driver/Driver/Library Driver/Driver/include Driver/examples Driver/examples/c Driver/examples/cpp D... | pharvey | 22 Oct |