diff --git a/add_tests.patch b/add_tests.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbd3d4a5b16c65728f9afcdc406d02dcc7ed9e19 --- /dev/null +++ b/add_tests.patch @@ -0,0 +1,27238 @@ +commit ff74e0a6aec91e1d2fe0ff6b3bb299c8e14f3bbc +Author: yanghaoran +Date: Sun Sep 26 16:20:54 2021 +0800 + + add tests + +diff --git a/unixODBC-2.3.7/tests/DlgDbcConnect.cpp b/unixODBC-2.3.7/tests/DlgDbcConnect.cpp +new file mode 100644 +index 0000000..b3c77e9 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgDbcConnect.cpp +@@ -0,0 +1,259 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2009-01-02 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgDbcConnect.h" ++#include "OdbcTest.h" ++ ++DlgDbcConnect::DlgDbcConnect( OdbcTest *pOdbcTest, QString stringTitle ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( stringTitle ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ // ++ QDialogButtonBox *pDialogButtonBox = new QDialogButtonBox( this ); ++ pDialogButtonBox->setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help ); ++ ++ // connection handles... ++ pcomboboxHandles = new QComboBox( this ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, pcomboboxHandles ); ++ ++ // servers... ++ pcomboboxServers = new QComboBox( this ); ++ pcomboboxServers->setEditable( true ); ++ pcomboboxServers->insertItem( 0, "" ); ++ pcomboboxServers->insertItem( 1, "" ); ++ pcomboboxServerLengths = new QComboBox( this ); ++ pcomboboxServerLengths->setEditable( true ); ++ pcomboboxServerLengths->insertItem( 0, "SQL_NTS=-3" ); ++ pcomboboxServerLengths->insertItem( 1, "0" ); ++ ++ { ++ // get last environment handle... ++ SQLHANDLE hEnvironment = SQL_NULL_HANDLE; ++ { ++ QListIterator i( pOdbcTest->listHandle ); ++ ++ while ( i.hasNext() ) ++ { ++ OdbcHandle *pOdbcHandle = i.next(); ++ if ( pOdbcHandle && pOdbcHandle->getType() == SQL_HANDLE_ENV ) ++ { ++ hEnvironment = pOdbcHandle->getHandle(); ++ } ++ } ++ } ++ ++ // use last environment handle to get list of servers (Data Source Names)... ++ if ( hEnvironment ) ++ { ++ SQLRETURN nReturn; ++ SQLCHAR szDataSourceName[ 128 ]; ++ int nIndex = 2; ++ ++ nReturn = SQLDataSources( hEnvironment, SQL_FETCH_FIRST, szDataSourceName, sizeof( szDataSourceName ), NULL, NULL, 0, NULL ); ++ while ( SQL_SUCCEEDED( nReturn ) ) ++ { ++ pcomboboxServers->insertItem( nIndex ++, ( char * )szDataSourceName ); ++ nReturn = SQLDataSources( hEnvironment, SQL_FETCH_NEXT, szDataSourceName, sizeof( szDataSourceName ), NULL, NULL, 0, NULL ); ++ } ++ } ++ } ++ ++ // users... ++ pcomboboxUsers = new QComboBox( this ); ++ pcomboboxUsers->setEditable( true ); ++ pcomboboxUsers->insertItem( 0, "" ); ++ pcomboboxUsers->insertItem( 1, "" ); ++ pcomboboxUserLengths = new QComboBox( this ); ++ pcomboboxUserLengths->setEditable( true ); ++ pcomboboxUserLengths->insertItem( 0, "SQL_NTS=-3" ); ++ pcomboboxUserLengths->insertItem( 1, "0" ); ++ ++ // authorizations... ++ pcomboboxAuthentications = new QComboBox( this ); ++ pcomboboxAuthentications->setEditable( true ); ++ pcomboboxAuthentications->insertItem( 0, "" ); ++ pcomboboxAuthentications->insertItem( 1, "" ); ++ pcomboboxAuthenticationLengths = new QComboBox( this ); ++ pcomboboxAuthenticationLengths->setEditable( true ); ++ pcomboboxAuthenticationLengths->insertItem( 0, "SQL_NTS=-3" ); ++ pcomboboxAuthenticationLengths->insertItem( 1, "0" ); ++ ++ // layout... ++ QVBoxLayout *pLayoutTop = new QVBoxLayout( this ); ++ ++ QGridLayout *pLayout = new QGridLayout(); ++ pLayoutTop->addLayout( pLayout ); ++ pLayoutTop->addWidget( pDialogButtonBox ); ++ ++ pLayout->addWidget( new QLabel( "Handle:", this ), 0, 0 ); ++ pLayout->addWidget( pcomboboxHandles, 0, 1 ); ++ ++ pLayout->addWidget( new QLabel( "Server:", this ), 1, 0 ); ++ pLayout->addWidget( pcomboboxServers, 1, 1 ); ++ ++ pLayout->addWidget( new QLabel( "String Length:", this ), 1, 2 ); ++ pLayout->addWidget( pcomboboxServerLengths, 1, 3 ); ++ ++ pLayout->addWidget( new QLabel( "User:", this ), 2, 0 ); ++ pLayout->addWidget( pcomboboxUsers, 2, 1 ); ++ ++ pLayout->addWidget( new QLabel( "String Length:", this ), 2, 2 ); ++ pLayout->addWidget( pcomboboxUserLengths, 2, 3 ); ++ ++ pLayout->addWidget( new QLabel( "Authentication:", this ), 3, 0 ); ++ pLayout->addWidget( pcomboboxAuthentications, 3, 1 ); ++ ++ pLayout->addWidget( new QLabel( "String Length:", this ), 3, 2 ); ++ pLayout->addWidget( pcomboboxAuthenticationLengths, 3, 3 ); ++ ++ // connect signals... ++ connect( pDialogButtonBox, SIGNAL(accepted()), this, SLOT(slotOk()) ); ++ connect( pDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) ); ++ connect( pDialogButtonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()) ); ++} ++ ++DlgDbcConnect::~DlgDbcConnect() ++{ ++} ++ ++void DlgDbcConnect::slotOk() ++{ ++ OdbcHandle *pOdbcHandle = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, pcomboboxHandles ); ++ SQLHANDLE hConnection = SQL_NULL_HANDLE; ++ QString stringServer = pcomboboxServers->currentText(); ++ QString stringUser = pcomboboxUsers->currentText(); ++ QString stringAuthentication = pcomboboxAuthentications->currentText(); ++ QString stringServerLength = pcomboboxServerLengths->currentText(); ++ QString stringUserLength = pcomboboxUserLengths->currentText(); ++ QString stringAuthenticationLength = pcomboboxAuthenticationLengths->currentText(); ++ ++ if ( pOdbcHandle ) ++ hConnection = pOdbcHandle->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLConnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ // connection handle... ++ if ( hConnection ) ++ pOdbcTest->out_win->append( QString( tr(" Connection Handle: %1") ).arg( (ulong)hConnection ) ); ++ else ++ pOdbcTest->out_win->append( tr(" Connection Handle: SQL_NULL_HDBC") ); ++ ++ // server string... ++ if ( stringServer == "" ) ++ { ++ stringServer = QString(); ++ pOdbcTest->out_win->append( tr(" Server: " ) ); ++ } ++ else if ( stringServer == "" ) ++ { ++ stringServer = ""; ++ pOdbcTest->out_win->append( tr(" Server: " ) ); ++ } ++ else ++ pOdbcTest->out_win->append( tr(" Server: ") + stringServer ); ++ ++ // server string length... ++ if ( stringServerLength.left( 7 ) == "SQL_NTS" ) ++ { ++ stringServerLength = QString::number( SQL_NTS ); ++ pOdbcTest->out_win->append( tr(" Server Len: SQL_NTS=-3" ) ); ++ } ++ else ++ pOdbcTest->out_win->append( QString( tr(" Server Len: %1") ).arg( stringServerLength.toInt() ) ); ++ ++ // user string... ++ if ( stringUser == "" ) ++ { ++ stringUser = QString(); ++ pOdbcTest->out_win->append( tr(" User: ") ); ++ } ++ else if ( stringUser == "" ) ++ { ++ stringUser = ""; ++ pOdbcTest->out_win->append( tr(" User: ") ); ++ } ++ else ++ pOdbcTest->out_win->append( QString( tr(" User: ") + stringUser ) ); ++ ++ // user string length... ++ if ( stringUserLength.left( 7 ) == "SQL_NTS" ) ++ { ++ stringUserLength = QString::number( SQL_NTS ); ++ pOdbcTest->out_win->append( tr(" User Len: SQL_NTS=-3") ); ++ } ++ else ++ pOdbcTest->out_win->append( QString( tr(" User Len: %1") ).arg( stringUserLength.toInt() ) ); ++ ++ // authorization string... ++ if ( stringAuthentication == "" ) ++ { ++ stringAuthentication = QString(); ++ pOdbcTest->out_win->append( tr(" Auth: ") ); ++ } ++ else if ( stringAuthentication == "" ) ++ { ++ stringAuthentication = ""; ++ pOdbcTest->out_win->append( tr(" Auth: ") ); ++ } ++ else ++ pOdbcTest->out_win->append( QString( tr(" Auth: ") + stringAuthentication ) ); ++ ++ // authorization string length... ++ if ( stringAuthenticationLength.left( 7 ) == "SQL_NTS" ) ++ { ++ stringAuthenticationLength = QString::number( SQL_NTS ); ++ pOdbcTest->out_win->append( tr(" Auth Len: SQL_NTS=-3" ) ); ++ } ++ else ++ pOdbcTest->out_win->append( QString( tr(" Auth Len: %1") ).arg( stringAuthenticationLength.toInt() ) ); ++ ++/* printf( "[PAH][%s][%d][%s] [%s][%d][%s][%d][%s][%d]\n", __FILE__, __LINE__, __FUNCTION__, ++ (SQLCHAR*)stringServer.toUtf8().data(), stringServerLength.toInt(), ++ (SQLCHAR*)stringUser.toUtf8().data(), stringUserLength.toInt(), ++ (SQLCHAR*)stringAuthentication.toUtf8().data(), stringAuthenticationLength.toInt() ); */ ++ // do it... ++ SQLRETURN nReturn = SQLConnect( hConnection, ++ (SQLCHAR*)stringServer.toUtf8().data(), stringServerLength.toInt(), ++ (SQLCHAR*)stringUser.toUtf8().data(), stringUserLength.toInt(), ++ (SQLCHAR*)stringAuthentication.toUtf8().data(), stringAuthenticationLength.toInt() ); ++ ++ // return value... ++ pOdbcTest->out_win->append( " Return:" ); ++ pOdbcTest->out_win->append( QString( tr(" %1=%2") ).arg( pOdbcTest->return_as_text( nReturn ) ).arg( nReturn ) ); ++ pOdbcTest->out_win->append( "" ); ++ ++ accept(); ++} ++ ++void DlgDbcConnect::slotHelp() ++{ ++} +diff --git a/unixODBC-2.3.7/tests/DlgDbcConnect.h b/unixODBC-2.3.7/tests/DlgDbcConnect.h +new file mode 100644 +index 0000000..7298193 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgDbcConnect.h +@@ -0,0 +1,58 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgDbcConnect : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgDbcConnect( OdbcTest *pOdbcTest, QString stringTitle ); ++ ~DlgDbcConnect(); ++ ++protected: ++ QComboBox * pcomboboxHandles; ++ QComboBox * pcomboboxServers; ++ QComboBox * pcomboboxUsers; ++ QComboBox * pcomboboxAuthentications; ++ QComboBox * pcomboboxServerLengths; ++ QComboBox * pcomboboxUserLengths; ++ QComboBox * pcomboboxAuthenticationLengths; ++ OdbcTest * pOdbcTest; ++ ++protected slots: ++ void slotOk(); ++ void slotHelp(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvAllocEnv.cpp b/unixODBC-2.3.7/tests/DlgEnvAllocEnv.cpp +new file mode 100644 +index 0000000..a57e0e8 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvAllocEnv.cpp +@@ -0,0 +1,100 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvAllocEnv.h" ++#include "OdbcTest.h" ++ ++void DlgEnvAllocEnv::handle_clkd() ++{ ++ if ( handle_valid->isChecked() ) ++ handle_valid->setText( "phenv: SQL_NULL_POINTER" ); ++ else ++ handle_valid->setText( "phenv: VALID" ); ++} ++ ++void DlgEnvAllocEnv::slotDone() ++{ ++ SQLHENV henv, *henv_ptr; ++ ++ pOdbcTest->out_win->append( "SQLAllocEnv():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( handle_valid->isChecked()) { ++ henv_ptr = NULL; ++ txt.sprintf( " phenv: SQL_NULL_HANDLE" ); ++ } else { ++ henv_ptr = &henv; ++ txt.sprintf( " phenv: %p", henv_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLAllocEnv( henv_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && henv_ptr ) { ++ txt.sprintf( " *phenv: %p", henv ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_ENV, henv ) ); ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ accept(); ++} ++ ++DlgEnvAllocEnv::DlgEnvAllocEnv( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ QVBoxLayout *playoutTop = new QVBoxLayout( this ); ++ ++ handle_valid = new QCheckBox( "phenv: VALID", this ); ++ playoutTop->addWidget( handle_valid ); ++ ++ pDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); ++ playoutTop->addWidget( pDialogButtonBox ); ++ ++ connect( handle_valid, SIGNAL( clicked()), this, SLOT( handle_clkd())); ++ connect( pDialogButtonBox, SIGNAL(accepted()), this, SLOT(slotDone()) ); ++ connect( pDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) ); ++ // connect( pDialogButtonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()) ); ++} ++ ++DlgEnvAllocEnv::~DlgEnvAllocEnv() ++{ ++ delete handle_valid; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvAllocEnv.h b/unixODBC-2.3.7/tests/DlgEnvAllocEnv.h +new file mode 100644 +index 0000000..0f12680 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvAllocEnv.h +@@ -0,0 +1,55 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvAllocEnv : public QDialog { ++ Q_OBJECT ++ ++public: ++ DlgEnvAllocEnv( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvAllocEnv(); ++ ++protected: ++ QDialogButtonBox * pDialogButtonBox; ++ QTextEdit * in_win; ++ QCheckBox * handle_valid; ++ QTextEdit * out_win; ++ OdbcTest * pOdbcTest; ++ QString txt; ++ ++protected slots: ++ void slotDone(); ++ void handle_clkd(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvAllocHandle.cpp b/unixODBC-2.3.7/tests/DlgEnvAllocHandle.cpp +new file mode 100644 +index 0000000..2e81c9b +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvAllocHandle.cpp +@@ -0,0 +1,172 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvAllocHandle.h" ++#include "OdbcTest.h" ++ ++void DlgEnvAllocHandle::slotDone() ++{ ++ SQLHANDLE out_handle, in_handle = SQL_NULL_HANDLE; ++ SQLRETURN ret; ++ SQLINTEGER type; ++ const char *handle; ++ ++ switch( types->currentIndex() ) ++ { ++ case 0: ++ type = SQL_HANDLE_ENV; ++ handle = "SQL_HANDLE_ENV=1"; ++ break; ++ ++ case 1: ++ type = SQL_HANDLE_DBC; ++ handle = "SQL_HANDLE_DBC=2"; ++ break; ++ ++ case 2: ++ type = SQL_HANDLE_STMT; ++ handle = "SQL_HANDLE_STMT=3"; ++ break; ++ ++ case 3: ++ type = SQL_HANDLE_DESC; ++ handle = "SQL_HANDLE_DESC=4"; ++ break; ++ } ++ ++ /* ++ * get input handle ++ */ ++ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( -1, handles ); ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ /* ++ * set output handle to something ++ */ ++ out_handle = 0; ++ ++ if ( valid->isChecked() ) ++ ret = SQLAllocHandle( type, in_handle, SQL_NULL_HANDLE ); ++ else ++ ret = SQLAllocHandle( type, in_handle, &out_handle ); ++ ++ pOdbcTest->out_win->append( "SQLAllocHandle():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ txt.sprintf( " Handle Type: %s", handle ); ++ pOdbcTest->out_win->append( txt ); ++ if ( in_handle ) ++ txt.sprintf( " InputHandle: %p", in_handle ); ++ else ++ txt.sprintf( " InputHandle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ if ( valid->isChecked() ) ++ txt.sprintf( " OutputHandle: SQL_NULL_HANDLE" ); ++ else ++ txt.sprintf( " OutputHandle: %p", &out_handle ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( out_handle ) ++ txt.sprintf( " *OutputHandle: %p", out_handle ); ++ else ++ txt.sprintf( " *OutputHandle: " ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->listHandle.append( new OdbcHandle( type, out_handle, pOdbcTest->listHandle )); ++ } ++ ++ accept(); ++} ++ ++void DlgEnvAllocHandle::out_handle_ptr_clkd() ++{ ++ if ( valid->isChecked() ) ++ valid->setText( "OutputHandlePtr: SQL_NULL_HANDLE" ); ++ else ++ valid->setText( "OutputHandlePtr: VALID" ); ++} ++ ++DlgEnvAllocHandle::DlgEnvAllocHandle( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ QVBoxLayout *playoutTop = new QVBoxLayout( this ); ++ QGridLayout *pLayout = new QGridLayout; ++ ++ playoutTop->addLayout( pLayout ); ++ ++ l_handle = new QLabel( "InputHandle:", this ); ++ handles = new QComboBox( this ); ++ pOdbcTest->fill_handle_list( -1, handles ); ++ pLayout->addWidget( l_handle, 0, 0 ); ++ pLayout->addWidget( handles, 0, 1 ); ++ ++ l_types = new QLabel( "HandleType:", this ); ++ types = new QComboBox( this ); ++ types->insertItem( 0, "SQL_HANDLE_ENV=1 (3.0)" ); ++ types->insertItem( 1, "SQL_HANDLE_DBC=2 (3.0)" ); ++ types->insertItem( 2, "SQL_HANDLE_STMT=3 (3.0)" ); ++ types->insertItem( 3, "SQL_HANDLE_DESC=3 (3.0)" ); ++ pLayout->addWidget( l_types, 1, 0 ); ++ pLayout->addWidget( types, 1, 1 ); ++ ++ valid = new QCheckBox( "OutputHandlePtr: VALID", this ); ++ pLayout->addWidget( valid, 2, 1 ); ++ ++ pDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); ++ playoutTop->addWidget( pDialogButtonBox ); ++ ++ connect( valid, SIGNAL( clicked()), this, SLOT( out_handle_ptr_clkd())); ++ connect( pDialogButtonBox, SIGNAL(accepted()), this, SLOT(slotDone()) ); ++ connect( pDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) ); ++// connect( pDialogButtonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()) ); ++} ++ ++DlgEnvAllocHandle::~DlgEnvAllocHandle() ++{ ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete valid; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvAllocHandle.h b/unixODBC-2.3.7/tests/DlgEnvAllocHandle.h +new file mode 100644 +index 0000000..9fc8016 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvAllocHandle.h +@@ -0,0 +1,58 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvAllocHandle : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvAllocHandle( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvAllocHandle(); ++ ++ protected: ++ QDialogButtonBox *pDialogButtonBox; ++ QComboBox *handles, *types; ++ QCheckBox *valid; ++ QLabel *l_handle, *l_types; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void out_handle_ptr_clkd(); ++ void slotDone(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvDataSources.cpp b/unixODBC-2.3.7/tests/DlgEnvDataSources.cpp +new file mode 100644 +index 0000000..70e0049 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvDataSources.cpp +@@ -0,0 +1,278 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvDataSources.h" ++#include "OdbcTest.h" ++ ++void DlgEnvDataSources::server_clkd() ++{ ++ if ( server_valid->isChecked() ) ++ server_valid->setText( "ServerName: SQL_NULL_POINTER" ); ++ else ++ server_valid->setText( "ServerName: VALID" ); ++} ++ ++void DlgEnvDataSources::description_clkd() ++{ ++ if ( description_valid->isChecked() ) ++ description_valid->setText( "Description: SQL_NULL_POINTER" ); ++ else ++ description_valid->setText( "Description: VALID" ); ++} ++ ++void DlgEnvDataSources::nlp1_clkd() ++{ ++ if ( nlp1_valid->isChecked() ) ++ nlp1_valid->setText( "NameLengthPtr1: SQL_NULL_POINTER" ); ++ else ++ nlp1_valid->setText( "NameLengthPtr1: VALID" ); ++} ++ ++void DlgEnvDataSources::nlp2_clkd() ++{ ++ if ( nlp2_valid->isChecked() ) ++ nlp2_valid->setText( "NameLengthPtr2: SQL_NULL_POINTER" ); ++ else ++ nlp2_valid->setText( "NameLengthPtr2: VALID" ); ++} ++ ++void DlgEnvDataSources::slotDone() ++{ ++ OdbcHandle *env = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLCHAR *server_name, *description; ++ SQLSMALLINT bl1, bl2, *nlp1, *nlp2, nl1, nl2; ++ SQLUSMALLINT direc; ++ ++ if ( env ) ++ in_handle = env->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLDataSources():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Environment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ direc = pEnvDataSourcesDirections[ direction->currentIndex() ].value; ++ txt.sprintf( " Direction: %s=%d", ++ pEnvDataSourcesDirections[ direction->currentIndex() ].text, ++ pEnvDataSourcesDirections[ direction->currentIndex() ].value ); ++ ++ bl1 = server_len->text().toInt(); ++ if ( server_valid->isChecked() ) ++ { ++ server_name = NULL; ++ txt.sprintf( " ServerName: " ); ++ } ++ else ++ { ++ if ( bl1 < 0 ) ++ bl1 = 300; ++ ++ server_name = new SQLCHAR[ bl1 ]; ++ ++ txt.sprintf( " ServerName: %p", bl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( nlp1_valid->isChecked() ) ++ { ++ nlp1 = NULL; ++ txt.sprintf( " NameLengthPtr 1: " ); ++ } ++ else ++ { ++ nl1 = -9999; ++ nlp1 = &nl1; ++ txt.sprintf( " NameLengthPtr 1: %p", nlp1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ bl2 = description_len->text().toInt(); ++ if ( description_valid->isChecked() ) ++ { ++ description = NULL; ++ txt.sprintf( " Description: " ); ++ } ++ else ++ { ++ if ( bl1 < 0 ) ++ bl1 = 300; ++ ++ description = new SQLCHAR[ bl1 ]; ++ ++ txt.sprintf( " Description: %p", bl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( nlp2_valid->isChecked() ) ++ { ++ nlp2 = NULL; ++ txt.sprintf( " NameLengthPtr 2: " ); ++ } ++ else ++ { ++ nl2 = -9999; ++ nlp2 = &nl2; ++ txt.sprintf( " NameLengthPtr 2: %p", nlp2 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLDataSources( in_handle, direc, server_name, bl1, nlp1, ++ description, bl2, nlp2 ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( server_name ) ++ { ++ txt.sprintf( " ServerName: %s", server_name ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( nlp1 ) ++ { ++ if ( nl1 == 9999 ) ++ { ++ txt.sprintf( " *NameLengthPtr 1: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NameLengthPtr 1: %d", nl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( description ) ++ { ++ txt.sprintf( " Description: %s", description ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( nlp2 ) ++ { ++ if ( nl2 == 9999 ) ++ { ++ txt.sprintf( " *NameLengthPtr 2: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NameLengthPtr 2: %d", nl2 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( server_name ) ++ delete server_name; ++ if ( description ) ++ delete description; ++} ++ ++DlgEnvDataSources::DlgEnvDataSources( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ QVBoxLayout *playoutTop = new QVBoxLayout( this ); ++ QGridLayout *pLayout = new QGridLayout; ++ ++ playoutTop->addLayout( pLayout ); ++ ++ l_handles = new QLabel( "Environment Handle:", this ); ++ handles = new QComboBox( this ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ pLayout->addWidget( l_handles, 0, 0 ); ++ pLayout->addWidget( handles, 0, 1 ); ++ ++ l_direction = new QLabel( "Direction:", this ); ++ direction = new QComboBox( this ); ++ pOdbcTest->fill_list_box( pEnvDataSourcesDirections, direction ); ++ pLayout->addWidget( l_direction, 1, 0 ); ++ pLayout->addWidget( direction, 1, 1 ); ++ ++ server_valid = new QCheckBox( "ServerName: VALID", this ); ++ l_server_len = new QLabel( "BufferLength 1:", this ); ++ server_len = new QLineEdit( this ); ++ server_len->setMaxLength( 6 ); ++ server_len->setText( "300" ); ++ nlp1_valid = new QCheckBox( "Name Length Ptr 1: VALID", this ); ++ pLayout->addWidget( server_valid, 2, 0 ); ++ pLayout->addWidget( l_server_len, 2, 1 ); ++ pLayout->addWidget( server_len, 2, 2 ); ++ pLayout->addWidget( nlp1_valid, 2, 3 ); ++ ++ description_valid = new QCheckBox( "Description: VALID", this ); ++ l_description_len = new QLabel( "BufferLength 2:", this ); ++ description_len = new QLineEdit( this ); ++ description_len->setMaxLength( 6 ); ++ description_len->setText( "300" ); ++ nlp2_valid = new QCheckBox( "Name Length Ptr 2: VALID", this ); ++ pLayout->addWidget( description_valid, 3, 0 ); ++ pLayout->addWidget( l_description_len, 3, 1 ); ++ pLayout->addWidget( description_len, 3, 2 ); ++ pLayout->addWidget( nlp2_valid, 3, 3 ); ++ ++ pDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); ++ playoutTop->addWidget( pDialogButtonBox ); ++ ++ connect( server_valid, SIGNAL( clicked()), this, SLOT( server_clkd())); ++ connect( nlp1_valid, SIGNAL( clicked()), this, SLOT( nlp1_clkd())); ++ connect( description_valid, SIGNAL( clicked()), this, SLOT( description_clkd())); ++ connect( nlp2_valid, SIGNAL( clicked()), this, SLOT( nlp2_clkd())); ++ ++ connect( pDialogButtonBox, SIGNAL(accepted()), this, SLOT(slotDone()) ); ++ connect( pDialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()) ); ++// connect( pDialogButtonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()) ); ++} ++ ++DlgEnvDataSources::~DlgEnvDataSources() ++{ ++ delete handles; ++ delete l_handles; ++ delete direction; ++ delete l_direction; ++ delete server_valid; ++ delete server_len; ++ delete l_server_len; ++ delete nlp1_valid; ++ delete description_valid; ++ delete description_len; ++ delete l_description_len; ++ delete nlp2_valid; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvDataSources.h b/unixODBC-2.3.7/tests/DlgEnvDataSources.h +new file mode 100644 +index 0000000..6c499f9 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvDataSources.h +@@ -0,0 +1,61 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvDataSources : public QDialog { ++ Q_OBJECT ++ ++public: ++ DlgEnvDataSources( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvDataSources(); ++ ++protected: ++ QDialogButtonBox *pDialogButtonBox; ++ QComboBox *handles, *direction; ++ QCheckBox *server_valid, *nlp1_valid, *description_valid, *nlp2_valid; ++ QLabel *l_handles, *l_direction, *l_server_len, *l_description_len; ++ QLineEdit *server_len, *description_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++protected slots: ++ void slotDone(); ++ void server_clkd(); ++ void description_clkd(); ++ void nlp1_clkd(); ++ void nlp2_clkd(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvDrivers.cpp b/unixODBC-2.3.7/tests/DlgEnvDrivers.cpp +new file mode 100644 +index 0000000..aafd290 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvDrivers.cpp +@@ -0,0 +1,291 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvDrivers.h" ++#include "OdbcTest.h" ++ ++void DlgEnvDrivers::server_clkd() ++{ ++ if ( server_valid->isChecked() ) ++ server_valid->setText( "ServerName: SQL_NULL_POINTER" ); ++ else ++ server_valid->setText( "ServerName: VALID" ); ++} ++ ++void DlgEnvDrivers::description_clkd() ++{ ++ if ( description_valid->isChecked() ) ++ description_valid->setText( "Description: SQL_NULL_POINTER" ); ++ else ++ description_valid->setText( "Description: VALID" ); ++} ++ ++void DlgEnvDrivers::nlp1_clkd() ++{ ++ if ( nlp1_valid->isChecked() ) ++ nlp1_valid->setText( "NameLengthPtr1: SQL_NULL_POINTER" ); ++ else ++ nlp1_valid->setText( "NameLengthPtr1: VALID" ); ++} ++ ++void DlgEnvDrivers::nlp2_clkd() ++{ ++ if ( nlp2_valid->isChecked() ) ++ nlp2_valid->setText( "NameLengthPtr2: SQL_NULL_POINTER" ); ++ else ++ nlp2_valid->setText( "NameLengthPtr2: VALID" ); ++} ++ ++void DlgEnvDrivers::Ok() ++{ ++ OdbcHandle *env = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLCHAR *server_name, *description; ++ SQLSMALLINT bl1, bl2, *nlp1, *nlp2, nl1, nl2; ++ SQLUSMALLINT direc; ++ ++ if ( env ) ++ in_handle = env->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLDrivers():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Environment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ direc = pEnvDriversDirections[ direction->currentIndex() ].value; ++ txt.sprintf( " Direction: %s=%d", ++ pEnvDriversDirections[ direction->currentIndex() ].text, ++ pEnvDriversDirections[ direction->currentIndex() ].value ); ++ ++ bl1 = server_len->text().toInt(); ++ if ( server_valid->isChecked() ) ++ { ++ server_name = NULL; ++ txt.sprintf( " ServerName: " ); ++ } ++ else ++ { ++ if ( bl1 < 0 ) ++ bl1 = 300; ++ ++ server_name = new SQLCHAR[ bl1 ]; ++ ++ txt.sprintf( " ServerName: %p", bl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( nlp1_valid->isChecked() ) ++ { ++ nlp1 = NULL; ++ txt.sprintf( " NameLengthPtr 1: " ); ++ } ++ else ++ { ++ nl1 = -9999; ++ nlp1 = &nl1; ++ txt.sprintf( " NameLengthPtr 1: %p", nlp1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ bl2 = description_len->text().toInt(); ++ if ( description_valid->isChecked() ) ++ { ++ description = NULL; ++ txt.sprintf( " Description: " ); ++ } ++ else ++ { ++ if ( bl1 < 0 ) ++ bl1 = 300; ++ ++ description = new SQLCHAR[ bl1 ]; ++ ++ txt.sprintf( " Description: %p", bl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( nlp2_valid->isChecked() ) ++ { ++ nlp2 = NULL; ++ txt.sprintf( " NameLengthPtr 2: " ); ++ } ++ else ++ { ++ nl2 = -9999; ++ nlp2 = &nl2; ++ txt.sprintf( " NameLengthPtr 2: %p", nlp2 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLDrivers( in_handle, direc, server_name, bl1, nlp1, ++ description, bl2, nlp2 ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( server_name ) ++ { ++ txt.sprintf( " ServerName: %s", server_name ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( nlp1 ) ++ { ++ if ( nl1 == 9999 ) ++ { ++ txt.sprintf( " *NameLengthPtr 1: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NameLengthPtr 1: %d", nl1 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( description ) ++ { ++ txt.sprintf( " Description: %s", description ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( nlp2 ) ++ { ++ if ( nl2 == 9999 ) ++ { ++ txt.sprintf( " *NameLengthPtr 2: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NameLengthPtr 2: %d", nl2 ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( server_name ) ++ delete server_name; ++ if ( description ) ++ delete description; ++} ++ ++DlgEnvDrivers::DlgEnvDrivers( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "Environment Handle:", this ); ++ l_handles->setGeometry( 10, 50, 120, 20 ); ++ ++ direction = new QComboBox( this ); ++ direction->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_list_box( pEnvDriversDirections, direction ); ++ ++ l_direction = new QLabel( "Direction:", this ); ++ l_direction->setGeometry( 10, 80, 120, 20 ); ++ ++ server_valid = new QCheckBox( "ServerName: VALID", this ); ++ server_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ server_len = new QLineEdit( this ); ++ server_len->setGeometry( 350, 110, 70, 20 ); ++ server_len->setMaxLength( 6 ); ++ server_len->setText( "300" ); ++ ++ l_server_len = new QLabel( "BufferLength 1:", this ); ++ l_server_len->setGeometry( 240, 110, 100, 20 ); ++ ++ nlp1_valid = new QCheckBox( "Name Length Ptr 1: VALID", this ); ++ nlp1_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ description_valid = new QCheckBox( "Description: VALID", this ); ++ description_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ description_len = new QLineEdit( this ); ++ description_len->setGeometry( 350, 170, 70, 20 ); ++ description_len->setMaxLength( 6 ); ++ description_len->setText( "300" ); ++ ++ l_description_len = new QLabel( "BufferLength 2:", this ); ++ l_description_len->setGeometry( 240, 170, 100, 20 ); ++ ++ nlp2_valid = new QCheckBox( "Name Length Ptr 2: VALID", this ); ++ nlp2_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( server_valid, SIGNAL( clicked()), this, SLOT( server_clkd())); ++ connect( nlp1_valid, SIGNAL( clicked()), this, SLOT( nlp1_clkd())); ++ connect( description_valid, SIGNAL( clicked()), this, SLOT( description_clkd())); ++ connect( nlp2_valid, SIGNAL( clicked()), this, SLOT( nlp2_clkd())); ++} ++ ++DlgEnvDrivers::~DlgEnvDrivers() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete direction; ++ delete l_direction; ++ delete server_valid; ++ delete server_len; ++ delete l_server_len; ++ delete nlp1_valid; ++ delete description_valid; ++ delete description_len; ++ delete l_description_len; ++ delete nlp2_valid; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvDrivers.h b/unixODBC-2.3.7/tests/DlgEnvDrivers.h +new file mode 100644 +index 0000000..4f8e5ee +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvDrivers.h +@@ -0,0 +1,62 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvDrivers : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvDrivers( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvDrivers(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *direction; ++ QCheckBox *server_valid, *nlp1_valid, *description_valid, *nlp2_valid; ++ QLabel *l_handles, *l_direction, *l_server_len, *l_description_len; ++ QLineEdit *server_len, *description_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void server_clkd(); ++ void description_clkd(); ++ void nlp1_clkd(); ++ void nlp2_clkd(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvEndTran.cpp b/unixODBC-2.3.7/tests/DlgEnvEndTran.cpp +new file mode 100644 +index 0000000..862d4f9 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvEndTran.cpp +@@ -0,0 +1,133 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvEndTran.h" ++#include "OdbcTest.h" ++ ++void DlgEnvEndTran::sel_handle( int /* index */ ) ++{ ++ int handle_t; ++ ++ handles->clear(); ++ handle_t = pEnvHandleTypes[ handle_type->currentIndex() ].value; ++ ++ pOdbcTest->fill_handle_list( handle_t, handles ); ++} ++ ++void DlgEnvEndTran::Ok() ++{ ++ int htype = pEnvHandleTypes[ handle_type->currentIndex() ].value; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( htype, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT completion; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLEndTran():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ txt.sprintf( " Handle Type: %s", pEnvHandleTypes[ handle_type->currentIndex() ].text ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Handle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ completion = pEnvCompletionTypes[ completion_type->currentIndex() ].value; ++ ++ SQLRETURN ret = SQLEndTran( htype, in_handle, completion ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++DlgEnvEndTran::DlgEnvEndTran( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 110,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 190,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 270,10, 70,25 ); ++ ++ handle_type = new QComboBox( this ); ++ handle_type->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_list_box( pEnvHandleTypes, handle_type ); ++ ++ l_handle_type = new QLabel( "Handle Type:", this ); ++ l_handle_type->setGeometry( 10, 50, 120, 20 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 80, 120, 20 ); ++ ++ completion_type = new QComboBox( this ); ++ completion_type->setGeometry( 130, 110, 200, 20 ); ++ pOdbcTest->fill_list_box( pEnvCompletionTypes, completion_type ); ++ ++ l_completion_type = new QLabel( "Completion Type:", this ); ++ l_completion_type->setGeometry( 10, 110, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( handle_type, SIGNAL(activated(int)), this, SLOT( sel_handle(int))); ++} ++ ++DlgEnvEndTran::~DlgEnvEndTran() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete handle_type; ++ delete l_handle_type; ++ delete completion_type; ++ delete l_completion_type; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvEndTran.h b/unixODBC-2.3.7/tests/DlgEnvEndTran.h +new file mode 100644 +index 0000000..216456d +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvEndTran.h +@@ -0,0 +1,57 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvEndTran : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvEndTran( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvEndTran(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *handle_type, *completion_type; ++ QLabel *l_handles, *l_handle_type, *l_completion_type; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void sel_handle( int ); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvFreeEnv.cpp b/unixODBC-2.3.7/tests/DlgEnvFreeEnv.cpp +new file mode 100644 +index 0000000..259f113 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvFreeEnv.cpp +@@ -0,0 +1,101 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvFreeEnv.h" ++#include "OdbcTest.h" ++ ++void DlgEnvFreeEnv::Ok() ++{ ++ OdbcHandle *env = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( env ) ++ in_handle = env->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLFreeEnv():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " henv: %p", in_handle ); ++ else ++ txt.sprintf( " henv: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLFreeEnv( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && in_handle ) ++ { ++ pOdbcTest->listHandle.removeAll( env ); ++ delete env; ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++DlgEnvFreeEnv::DlgEnvFreeEnv( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 120, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "henv:", this ); ++ l_handles->setGeometry( 10, 50, 100, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++DlgEnvFreeEnv::~DlgEnvFreeEnv() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvFreeEnv.h b/unixODBC-2.3.7/tests/DlgEnvFreeEnv.h +new file mode 100644 +index 0000000..d40af44 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvFreeEnv.h +@@ -0,0 +1,56 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvFreeEnv : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvFreeEnv( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvFreeEnv(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QTextEdit *in_win; ++ QComboBox *handles; ++ QLabel *l_handles; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvFreeHandle.cpp b/unixODBC-2.3.7/tests/DlgEnvFreeHandle.cpp +new file mode 100644 +index 0000000..ba86355 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvFreeHandle.cpp +@@ -0,0 +1,146 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvFreeHandle.h" ++#include "OdbcTest.h" ++ ++void DlgEnvFreeHandle::Ok() ++{ ++SQLHANDLE in_handle = SQL_NULL_HANDLE; ++SQLRETURN ret; ++SQLINTEGER type; ++const char *handle; ++ ++ switch( types->currentIndex()) ++ { ++ case 0: ++ type = SQL_HANDLE_ENV; ++ handle = "SQL_HANDLE_ENV=1"; ++ break; ++ ++ case 1: ++ type = SQL_HANDLE_DBC; ++ handle = "SQL_HANDLE_DBC=2"; ++ break; ++ ++ case 2: ++ type = SQL_HANDLE_STMT; ++ handle = "SQL_HANDLE_STMT=3"; ++ break; ++ ++ case 3: ++ type = SQL_HANDLE_DESC; ++ handle = "SQL_HANDLE_DESC=4"; ++ break; ++ } ++ ++ /* ++ * get input handle ++ */ ++ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( -1, handles ); ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ ret = SQLFreeHandle( type, in_handle ); ++ ++ pOdbcTest->out_win->append( "SQLFreeHandle():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ txt.sprintf( " Handle Type: %s", handle ); ++ pOdbcTest->out_win->append( txt ); ++ if ( in_handle ) ++ txt.sprintf( " InputHandle: %p", in_handle ); ++ else ++ txt.sprintf( " InputHandle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->listHandle.removeAll( hand ); ++ delete hand; ++ } ++} ++ ++DlgEnvFreeHandle::DlgEnvFreeHandle( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 120, 80, 200, 20 ); ++ ++ pOdbcTest->fill_handle_list( -1, handles ); ++ ++ types = new QComboBox( this ); ++ types->setGeometry( 120, 50, 200, 20 ); ++ ++ types->insertItem( 0, "SQL_HANDLE_ENV=1 (3.0)" ); ++ types->insertItem( 1, "SQL_HANDLE_DBC=2 (3.0)" ); ++ types->insertItem( 2, "SQL_HANDLE_STMT=3 (3.0)" ); ++ types->insertItem( 3, "SQL_HANDLE_DESC=3 (3.0)" ); ++ ++ l_handle = new QLabel( "InputHandle:", this ); ++ l_handle->setGeometry( 10, 80, 70, 20 ); ++ ++ l_types = new QLabel( "HandleType:", this ); ++ l_types->setGeometry( 10, 50, 70, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++DlgEnvFreeHandle::~DlgEnvFreeHandle() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvFreeHandle.h b/unixODBC-2.3.7/tests/DlgEnvFreeHandle.h +new file mode 100644 +index 0000000..57399b5 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvFreeHandle.h +@@ -0,0 +1,57 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvFreeHandle : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvFreeHandle( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvFreeHandle(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *valid; ++ QLabel *l_handle, *l_types; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvTransact.cpp b/unixODBC-2.3.7/tests/DlgEnvTransact.cpp +new file mode 100644 +index 0000000..76a7054 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvTransact.cpp +@@ -0,0 +1,126 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgEnvTransact.h" ++#include "OdbcTest.h" ++ ++void DlgEnvTransact::Ok() ++{ ++ OdbcHandle *ehand = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, ehandles ); ++ OdbcHandle *chand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, chandles ); ++ SQLHANDLE ein_handle = SQL_NULL_HANDLE; ++ SQLHANDLE cin_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT completion; ++ ++ if ( ehand ) ++ ein_handle = ehand->getHandle(); ++ if ( chand ) ++ cin_handle = chand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLTransact():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( ein_handle ) ++ txt.sprintf( " henv: %p", ein_handle ); ++ else ++ txt.sprintf( " henv: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( cin_handle ) ++ txt.sprintf( " hdbc: %p", cin_handle ); ++ else ++ txt.sprintf( " hdbc: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ completion = pEnvCompletionTypes[ completion_type->currentIndex() ].value; ++ ++ SQLRETURN ret = SQLTransact( ein_handle, cin_handle, completion ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++DlgEnvTransact::DlgEnvTransact( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 110,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 190,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 270,10, 70,25 ); ++ ++ ehandles = new QComboBox( this ); ++ ehandles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, ehandles ); ++ ++ l_ehandles = new QLabel( "henv:", this ); ++ l_ehandles->setGeometry( 10, 50, 120, 20 ); ++ ++ chandles = new QComboBox( this ); ++ chandles->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, chandles ); ++ ++ l_chandles = new QLabel( "hdbc:", this ); ++ l_chandles->setGeometry( 10, 80, 120, 20 ); ++ ++ completion_type = new QComboBox( this ); ++ completion_type->setGeometry( 130, 110, 200, 20 ); ++ pOdbcTest->fill_list_box( pEnvCompletionTypes, completion_type ); ++ ++ l_completion_type = new QLabel( "fType Type:", this ); ++ l_completion_type->setGeometry( 10, 110, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++DlgEnvTransact::~DlgEnvTransact() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete ehandles; ++ delete l_ehandles; ++ delete chandles; ++ delete l_chandles; ++ delete completion_type; ++ delete l_completion_type; ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgEnvTransact.h b/unixODBC-2.3.7/tests/DlgEnvTransact.h +new file mode 100644 +index 0000000..204b00c +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgEnvTransact.h +@@ -0,0 +1,58 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgEnvTransact : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ DlgEnvTransact( OdbcTest *pOdbcTest, QString name ); ++ ~DlgEnvTransact(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QTextEdit *in_win; ++ QComboBox *ehandles, *chandles; ++ QLabel *l_ehandles, *l_chandles; ++ QComboBox *completion_type; ++ QLabel *l_completion_type; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.cpp b/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.cpp +new file mode 100644 +index 0000000..f6da7ca +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.cpp +@@ -0,0 +1,318 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsManageAutoTest.h" ++#include "OdbcTest.h" ++ ++DlgToolsManageAutoTest::DlgToolsManageAutoTest( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ from = new QPushButton( "From", this ); ++ from->setGeometry( 10,18, 70,25 ); ++ ++ s_from = new QLabel( "Path", this ); ++ s_from->setGeometry( 100, 20, 300, 20 ); ++ ++ add = new QPushButton( "Add >", this ); ++ add->setGeometry( 180,90, 70,25 ); ++ ++ remove = new QPushButton( "< Remove", this ); ++ remove->setGeometry( 180,130, 70,25 ); ++ ++ close = new QPushButton( "Close", this ); ++ close->setGeometry( 180,200, 70,25 ); ++ ++ lib_list = new QListWidget( this ); ++ lib_list->setGeometry( 10, 80, 150, 160 ); ++ ++ test_list = new QListWidget( this ); ++ test_list->setGeometry( 270, 80, 250, 160 ); ++ ++ l_avail = new QLabel( "Available Test Libs:", this ); ++ l_avail->setGeometry( 10, 55, 200, 20 ); ++ ++ l_lib = new QLabel( "Installed Auto Tests:", this ); ++ l_lib->setGeometry( 270, 55, 200, 20 ); ++ ++ l_name = new QLabel( "Name:", this ); ++ l_name->setGeometry( 10, 255, 200, 20 ); ++ ++ l_so = new QLabel( "Lib:", this ); ++ l_so->setGeometry( 10, 280, 200, 20 ); ++ ++ s_name = new QLabel( "NAME", this ); ++ s_name->setGeometry( 70, 255, 200, 20 ); ++ ++ s_lib = new QLabel( "LIB", this ); ++ s_lib->setGeometry( 70, 280, 300, 20 ); ++ ++ connect( close, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( close, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( from, SIGNAL(clicked()), SLOT(From()) ); ++ connect( add, SIGNAL(clicked()), SLOT(Add()) ); ++ connect( remove, SIGNAL(clicked()), SLOT(Remove()) ); ++ ++ // load test list... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ test_list->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // ++ // Setup the path, initially to the current directory ++ // ++ { ++ QSettings settings( "unixODBC-GUI-Qt", "OdbcTestQ4" ); ++ ++ settings.beginGroup( "DlgToolsManageAutoTest" ); ++ QString stringPath = settings.value( "From", QDir::currentPath() ).toString(); ++ settings.endGroup(); ++ ++ setPath( stringPath ); ++ } ++ ++ connect( test_list, SIGNAL(currentTextChanged(const QString &)), SLOT(ListSelect(const QString&)) ); ++ ++ test_list->setCurrentItem( 0 ); ++} ++ ++DlgToolsManageAutoTest::~DlgToolsManageAutoTest() ++{ ++ // sync settings with disk (mostly means 'save changes') ++ { ++ pOdbcTest->pSettings->sync(); ++ QSettings::Status nStatus = pOdbcTest->pSettings->status(); ++ switch ( nStatus ) ++ { ++ case QSettings::AccessError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AccessError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::FormatError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("FormatError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::NoError: ++ default: ++ break; ++ } ++ } ++ ++ delete close; ++ delete add; ++ delete remove; ++ delete from; ++ delete s_from; ++ delete lib_list; ++ delete test_list; ++ delete l_avail; ++ delete l_lib; ++ delete l_name; ++ delete l_so; ++ delete s_name; ++ delete s_lib; ++} ++ ++void DlgToolsManageAutoTest::Ok() ++{ ++} ++ ++void DlgToolsManageAutoTest::setPath( QString &stringPath ) ++{ ++ s_from->setText( stringPath ); ++ ++ // ++ // extract any libs from the path ++ // ++ ++ lib_list->clear(); ++ ++ QDir q_d( stringPath ); ++ if ( q_d.exists()) ++ { ++ q_d.setFilter( QDir::Files | QDir::Hidden ); ++ for ( uint i=0; i < q_d.count(); i++ ) ++ { ++ lib_list ->addItem( q_d[i] ); ++ } ++ } ++} ++ ++void DlgToolsManageAutoTest::Add() ++{ ++ int index = lib_list ->currentRow(); ++ ++ if ( index < 0 ) ++ return; ++ ++ QListWidgetItem *lbi = lib_list->item( index ); ++ QDir q_d( s_from->text()); ++ QString path = q_d.filePath ( lbi->text() ); ++ QLibrary l( path ); ++ ++ if ( !l.load() ) ++ { ++ QMessageBox::critical( pOdbcTest, "OdbcTest", l.errorString() + tr("\nWhile trying to load;\n") + path ); ++ return; ++ } ++ ++ // ++ // Try and extract the symbols ++ // ++ void *pfAutoTestDesc, *pfAutoTestFunc; ++ BOOL (*pfAutoTestName)(LPSTR,UINT*); ++ ++ pfAutoTestName = (BOOL(*)(LPSTR,UINT*))l.resolve( "AutoTestName" ); ++ pfAutoTestDesc = l.resolve( "AutoTestDesc" ); ++ pfAutoTestFunc = l.resolve( "AutoTestFunc" ); ++ ++ if ( !pfAutoTestName && ++ !pfAutoTestDesc && ++ !pfAutoTestFunc ) ++ { ++ QMessageBox::critical( pOdbcTest, "OdbcTest", l.errorString() ); ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("Could not find one or more of AutoTestName, AutoTestDesc, or AutoTestFunc in auto test\n%1") ).arg( path ) ); ++ return; ++ } ++ ++ char szAutoTestName[ AUTO_MAX_TEST_NAME + 1 ]; // name of test as provided by test library ++ UINT nTestCases = 0; // each test library may have 0-n test cases ++ ++ if ( pfAutoTestName ) ++ { ++ // get the test name... ++ if ( !pfAutoTestName( szAutoTestName, &nTestCases ) ) ++ { ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AutoTestName returned FALSE in %1") ).arg( path ) ); ++ return; ++ } ++ } ++ else ++ { ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AutoTestName not exported from %1") ).arg( path ) ); ++ return; ++ } ++ ++ // does test already exist... ++ if ( pOdbcTest->pSettings->contains( szAutoTestName ) ) ++ { ++ QMessageBox::information( pOdbcTest, "OdbcTest", QString( tr("Auto test '%1'already installed") ).arg( szAutoTestName ) ); ++ return; ++ } ++ ++ // add test to master list... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ pOdbcTest->pSettings->setValue( szAutoTestName, nTestCases ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // add test section & entries... ++ pOdbcTest->pSettings->beginGroup( szAutoTestName ); ++ pOdbcTest->pSettings->setValue( "DLL", path ); /*! \todo escape slashs */ ++ pOdbcTest->pSettings->endGroup(); ++ ++ // reload list... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ test_list->clear(); ++ test_list->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ test_list->setCurrentItem( 0 ); ++ ListSelect( szAutoTestName ); ++} ++ ++void DlgToolsManageAutoTest::From() ++{ ++ QFileDialog FileDialog( this, "From..." ); ++ ++ FileDialog.setDirectory( s_from->text() ); ++ FileDialog.setFileMode( QFileDialog::Directory ); ++ ++ if ( FileDialog.exec() == QDialog::Accepted ) ++ { ++ QString stringPath = FileDialog.directory().absolutePath(); ++ ++ setPath( stringPath ); ++ ++ QSettings settings( "unixODBC-GUI-Qt", "OdbcTestQ4" ); ++ settings.beginGroup( "DlgToolsManageAutoTest" ); ++ settings.setValue( "From", stringPath ); ++ settings.endGroup(); ++ } ++} ++ ++void DlgToolsManageAutoTest::ListSelect( const QString &name ) ++{ ++ if ( pOdbcTest->pSettings->childGroups().contains( name ) ) ++ { ++ s_name->setText( name ); ++ s_lib->setText( "" ); ++ ++ // get the DLL name... ++ pOdbcTest->pSettings->beginGroup( name ); ++ s_lib->setText( pOdbcTest->pSettings->value( "DLL" ).toString() ); ++ pOdbcTest->pSettings->endGroup(); ++ } ++ else ++ { ++ s_name->setText( "" ); ++ s_lib->setText( "" ); ++ } ++} ++ ++void DlgToolsManageAutoTest::Remove() ++{ ++ QListWidgetItem *pListWidgetItem = test_list->currentItem(); ++ ++ if ( !pListWidgetItem ) ++ return; ++ ++ // remove from master list... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ pOdbcTest->pSettings->remove( pListWidgetItem->text() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // remove section & entries... ++ pOdbcTest->pSettings->remove( pListWidgetItem->text() ); ++ ++ // reload list... ++ { ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ test_list->clear(); ++ test_list->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // select first item... ++ if ( test_list->count() ) ++ { ++ test_list->setCurrentItem( 0 ); ++ ListSelect( test_list->currentItem()->text() ); ++ } ++ } ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.h b/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.h +new file mode 100644 +index 0000000..5a14828 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageAutoTest.h +@@ -0,0 +1,59 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgToolsManageAutoTest : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgToolsManageAutoTest( OdbcTest *pOdbcTest, QString name ); ++ ~DlgToolsManageAutoTest(); ++ ++protected: ++ QPushButton * close, *add, *remove, *from; ++ OdbcTest * pOdbcTest; ++ QLabel * l_avail, *l_name, *l_lib, *l_so, *l_installed, *s_from, *s_name, *s_lib; ++ QListWidget * lib_list, *test_list; ++ ++ void setPath( QString &stringPath ); ++ ++protected slots: ++ void Ok(); ++ void From(); ++ void Add(); ++ void ListSelect( const QString &name ); ++ void Remove(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageTest.cpp b/unixODBC-2.3.7/tests/DlgToolsManageTest.cpp +new file mode 100644 +index 0000000..12b3cb4 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageTest.cpp +@@ -0,0 +1,260 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsManageTest.h" ++#include "DlgToolsNewSource.h" ++#include "OdbcTest.h" ++ ++DlgToolsManageTest::DlgToolsManageTest( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ close = new QPushButton( "Close", this ); ++ close->setGeometry( 270,80, 70,25 ); ++ ++ nw = new QPushButton( "New", this ); ++ nw->setGeometry( 270,110, 70,25 ); ++ ++ del = new QPushButton( "Delete", this ); ++ del->setGeometry( 270,140, 70,25 ); ++ ++ test_source = new QComboBox( this ); ++ test_source->setGeometry( 100, 20, 250, 20 ); ++ ++ l_ts = new QLabel( "Test Source:", this ); ++ l_ts->setGeometry( 10, 20, 80, 20 ); ++ ++ param = new QGroupBox( "Connect Parameters", this ); ++ param->setGeometry( 10, 60, 240, 125 ); ++ ++ dsn = new QComboBox( this ); ++ dsn->setGeometry( 80, 90, 150, 20 ); ++ ++ l_dsn = new QLabel( "DSN:", this ); ++ l_dsn->setGeometry( 20, 90, 60, 20 ); ++ ++ uid = new QLineEdit( this ); ++ uid->setGeometry( 80, 120, 150, 20 ); ++ uid->setMaxLength( 128 ); ++ ++ l_uid = new QLabel( "UID:", this ); ++ l_uid->setGeometry( 20, 120, 60, 20 ); ++ ++ pwd = new QLineEdit( this ); ++ pwd->setGeometry( 80, 150, 150, 20 ); ++ pwd->setMaxLength( 128 ); ++ ++ l_pwd = new QLabel( "PWD:", this ); ++ l_pwd->setGeometry( 20, 150, 60, 20 ); ++ ++ kw = new QLineEdit( this ); ++ kw->setGeometry( 80, 200, 250, 20 ); ++ kw->setMaxLength( 128 ); ++ ++ l_kw = new QLabel( "Keywords:", this ); ++ l_kw->setGeometry( 10, 200, 60, 20 ); ++ ++ connect( close, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( close, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( nw, SIGNAL(clicked()), SLOT(NewSource()) ); ++ ++ connect( del, SIGNAL(clicked()), SLOT(DelSource()) ); ++ ++ // load driver list... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ test_source->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // load dsn list... ++ pOdbcTest->fill_dsn_list( dsn ); ++ ++ // ++ // set up other fields ++ // ++ Activated( 0 ); ++ connect( test_source, SIGNAL(activated(const QString &)), this, SLOT( Activated(const QString &))); ++} ++ ++DlgToolsManageTest::~DlgToolsManageTest() ++{ ++ // sync settings with disk (mostly means 'save changes') ++ { ++ pOdbcTest->pSettings->sync(); ++ QSettings::Status nStatus = pOdbcTest->pSettings->status(); ++ switch ( nStatus ) ++ { ++ case QSettings::AccessError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AccessError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::FormatError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("FormatError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::NoError: ++ default: ++ break; ++ } ++ } ++ ++ delete close; ++ delete nw; ++ delete del; ++ delete test_source; ++ delete dsn; ++ delete l_dsn; ++ delete l_ts; ++ delete pwd; ++ delete l_pwd; ++ delete kw; ++ delete l_kw; ++ delete param; ++} ++ ++void DlgToolsManageTest::Activated( const QString &str ) ++{ ++ // did we find section... ++ if ( pOdbcTest->pSettings->contains( str ) ) ++ { ++ uid->clear(); ++ pwd->clear(); ++ kw->clear(); ++ return; ++ } ++ ++ // load dsn details... ++ pOdbcTest->pSettings->beginGroup( str ); ++ foreach ( QString stringKey, pOdbcTest->pSettings->allKeys() ) ++ { ++ if ( stringKey == "SERVER0" ) ++ { ++ pOdbcTest->set_dsn_list( dsn, pOdbcTest->pSettings->value( stringKey ).toString() ); ++ } ++ else if ( stringKey == "LOGIN0" ) ++ { ++ uid->setText( pOdbcTest->pSettings->value( stringKey ).toString() ); ++ } ++ else if ( stringKey == "PASSWORD0" ) ++ { ++ pwd->setText( pOdbcTest->pSettings->value( stringKey ).toString() ); ++ } ++ else if ( stringKey == "KEYWORDS" ) ++ { ++ kw->setText( pOdbcTest->pSettings->value( stringKey ).toString() ); ++ } ++ } ++ pOdbcTest->pSettings->endGroup(); ++} ++ ++void DlgToolsManageTest::Activated( int val ) ++{ ++ if ( test_source->count() > 0 ) ++ { ++ Activated( test_source->itemText( val ) ); ++ } ++} ++ ++void DlgToolsManageTest::Ok() ++{ ++ // find driver name... ++ QString driver = test_source->currentText(); ++ ++ if ( driver.isEmpty() ) ++ return; ++ ++ // apply... ++ pOdbcTest->pSettings->beginGroup( driver ); ++ pOdbcTest->pSettings->remove( "" ); // removes all key/values within group ++ pOdbcTest->pSettings->setValue( "SERVER0", dsn->currentText() ); ++ pOdbcTest->pSettings->setValue( "LOGIN0", uid->text() ); ++ pOdbcTest->pSettings->setValue( "PASSWORD0", pwd->text() ); ++ pOdbcTest->pSettings->setValue( "KEYWORDS", kw->text() ); ++ pOdbcTest->pSettings->endGroup(); ++} ++ ++void DlgToolsManageTest::NewSource() ++{ ++ DlgToolsNewSource *dlg = new DlgToolsNewSource( pOdbcTest, "New Test Sources", this ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++ ++ // reload list... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ test_source->clear(); ++ test_source->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // make last (new one) the current one... ++ Activated( test_source->count() - 1 ); ++ test_source->setCurrentIndex( test_source->count() - 1 ); ++} ++ ++void DlgToolsManageTest::DelSource() ++{ ++ if ( test_source->count() == 0 ) ++ return; ++ ++ // which driver is current... ++ QString driver = test_source->currentText(); ++ if ( driver.isEmpty() ) ++ return; ++ ++ // do we really want to do this... ++ if ( QMessageBox::information( this, "OdbcTest", ++ QString( "Delete the test source %1?" ).arg( driver ), ++ "&Delete", "&Cancel", 0, ++ 0, 1 ) != 0 ) ++ ++ { ++ return; ++ } ++ ++ // remove from master list... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ pOdbcTest->pSettings->remove( driver ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // remove section... ++ pOdbcTest->pSettings->remove( driver ); ++ ++ // reload list... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ test_source->clear(); ++ test_source->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // make first the current one... ++ Activated( 0 ); ++ test_source->setCurrentIndex( 0 ); ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageTest.h b/unixODBC-2.3.7/tests/DlgToolsManageTest.h +new file mode 100644 +index 0000000..0bc2dd4 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageTest.h +@@ -0,0 +1,64 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++class DlgToolsNewSource; ++ ++class DlgToolsManageTest : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgToolsManageTest( OdbcTest *pOdbcTest, QString name ); ++ ~DlgToolsManageTest(); ++ ++ friend class DlgToolsNewSource; ++ ++protected: ++ QPushButton *close, *nw, *del; ++ OdbcTest *pOdbcTest; ++ QComboBox *test_source; ++ QComboBox*dsn; ++ QLabel *l_dsn, *l_ts, *l_uid, *l_pwd, *l_kw; ++ QLineEdit *uid, *pwd, *kw; ++ QGroupBox *param; ++ ++ ++protected slots: ++ void Ok(); ++ void NewSource(); ++ void DelSource(); ++ void Activated( int index ); ++ void Activated( const QString &str ); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.cpp b/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.cpp +new file mode 100644 +index 0000000..933e22a +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.cpp +@@ -0,0 +1,248 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsManageTestGroup.h" ++#include "DlgToolsNewGroup.h" ++#include "OdbcTest.h" ++ ++DlgToolsManageTestGroup::DlgToolsManageTestGroup( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ nw = new QPushButton( "New", this ); ++ nw->setGeometry( 300,15, 70,25 ); ++ ++ del = new QPushButton( "Delete", this ); ++ del->setGeometry( 380,15, 70,25 ); ++ ++ add = new QPushButton( "Add >", this ); ++ add->setGeometry( 280,90, 70,25 ); ++ ++ remove = new QPushButton( "< Remove", this ); ++ remove->setGeometry( 280,130, 70,25 ); ++ ++ close = new QPushButton( "Close", this ); ++ close->setGeometry( 280,200, 70,25 ); ++ ++ group = new QComboBox( this ); ++ group->setGeometry( 100, 15, 180, 20 ); ++ ++ l_group = new QLabel( "Test Group:", this ); ++ l_group->setGeometry( 10, 15, 60, 20 ); ++ ++ l_auto = new QLabel( "Installed Auto Tests:", this ); ++ l_auto->setGeometry( 10, 60, 160, 20 ); ++ ++ l_sauto = new QLabel( "Selected Auto Tests:", this ); ++ l_sauto->setGeometry( 370, 60, 160, 20 ); ++ ++ auto_list = new QListWidget( this ); ++ auto_list->setGeometry( 10, 80, 250, 160 ); ++ ++ sauto_list = new QListWidget( this ); ++ sauto_list->setGeometry( 370, 80, 250, 160 ); ++ ++ connect( close, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( close, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( add, SIGNAL(clicked()), SLOT(Add()) ); ++ connect( remove, SIGNAL(clicked()), SLOT(Remove()) ); ++ connect( nw, SIGNAL(clicked()), SLOT(New()) ); ++ connect( del, SIGNAL(clicked()), SLOT(Delete()) ); ++ ++ // load the list... ++ pOdbcTest->pSettings->beginGroup( "GROUPS" ); ++ group->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ Activated( 0 ); ++ connect( group, SIGNAL(activated(const QString &)), this, SLOT( Activated(const QString &))); ++} ++ ++DlgToolsManageTestGroup::~DlgToolsManageTestGroup() ++{ ++ // sync settings with disk (mostly means 'save changes') ++ { ++ pOdbcTest->pSettings->sync(); ++ QSettings::Status nStatus = pOdbcTest->pSettings->status(); ++ switch ( nStatus ) ++ { ++ case QSettings::AccessError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AccessError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::FormatError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("FormatError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::NoError: ++ default: ++ break; ++ } ++ } ++ ++ delete close; ++ delete add; ++ delete remove; ++ delete nw; ++ delete del; ++ delete group; ++ delete l_group; ++ delete l_auto; ++ delete l_sauto; ++ delete auto_list; ++ delete sauto_list; ++} ++ ++void DlgToolsManageTestGroup::Ok() ++{ ++} ++ ++// ++// for a given test, look at each entry in the auto test section, see if it ++// is in the group section, if so it goes in the selected, else the installed list ++// ++ ++void DlgToolsManageTestGroup::update_test_lists( void ) ++{ ++ QString stringGroup = group->currentText(); ++ ++ auto_list->clear(); ++ sauto_list->clear(); ++ ++ // get list of "Auto Tests"... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ QStringList stringlistAutoTests = pOdbcTest->pSettings->allKeys(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // for each "Auto Tests"... ++ foreach ( QString stringAutoTest, stringlistAutoTests ) ++ { ++ if ( pOdbcTest->pSettings->contains( stringGroup + "/" + stringAutoTest ) ) ++ sauto_list->addItem( stringAutoTest ); ++ else ++ auto_list->addItem( stringAutoTest ); ++ } ++} ++ ++void DlgToolsManageTestGroup::Activated( const QString & ) ++{ ++ update_test_lists(); ++} ++ ++void DlgToolsManageTestGroup::Activated( int val ) ++{ ++ if ( group->count() > 0 ) ++ Activated( group->itemText( val ) ); ++} ++ ++void DlgToolsManageTestGroup::Add() ++{ ++ QListWidgetItem *pListWidgetItem = auto_list->currentItem(); ++ if ( !pListWidgetItem ) ++ return; ++ ++ QString stringAutoTest = pListWidgetItem->text(); ++ if ( stringAutoTest.isEmpty() ) ++ return; ++ ++ QString stringGroup = group->currentText(); ++ if ( stringGroup.isEmpty() ) ++ return; ++ ++ pOdbcTest->pSettings->beginGroup( stringGroup ); ++ pOdbcTest->pSettings->setValue( stringAutoTest, "Installed" ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ update_test_lists(); ++} ++ ++void DlgToolsManageTestGroup::Remove() ++{ ++ QListWidgetItem *pListWidgetItem = sauto_list->currentItem(); ++ if ( !pListWidgetItem ) ++ return; ++ ++ QString stringAutoTest = pListWidgetItem->text(); ++ if ( stringAutoTest.isEmpty() ) ++ return; ++ ++ QString stringGroup = group->currentText(); ++ if ( stringGroup.isEmpty() ) ++ return; ++ ++ pOdbcTest->pSettings->beginGroup( stringGroup ); ++ pOdbcTest->pSettings->remove( stringAutoTest ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ update_test_lists(); ++} ++ ++void DlgToolsManageTestGroup::New() ++{ ++ DlgToolsNewGroup *dlg = new DlgToolsNewGroup( pOdbcTest, "New Test Group", this ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void DlgToolsManageTestGroup::Delete() ++{ ++ QString stringGroup = group->currentText(); ++ if ( stringGroup.isEmpty() ) ++ return; ++ ++ if ( QMessageBox::information( this, "OdbcTest", ++ QString( "Delete the test group %1?" ).arg( stringGroup ), ++ "&Delete", "&Cancel", 0, ++ 0, 1 ) != 0 ) ++ { ++ return; ++ } ++ ++ // remove from GROUPS section... ++ pOdbcTest->pSettings->beginGroup( "GROUPS" ); ++ pOdbcTest->pSettings->remove( stringGroup ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // remove its section... ++ pOdbcTest->pSettings->remove( stringGroup ); ++ ++ // reload list... ++ pOdbcTest->pSettings->beginGroup( "GROUPS" ); ++ group->clear(); ++ group->addItems( pOdbcTest->pSettings->allKeys() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // make first item current... ++ group->setCurrentIndex( 0 ); ++ Activated( 0 ); ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.h b/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.h +new file mode 100644 +index 0000000..a17ef5c +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsManageTestGroup.h +@@ -0,0 +1,66 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++class DlgToolsNewGroup; ++ ++class DlgToolsManageTestGroup : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgToolsManageTestGroup( OdbcTest *pOdbcTest, QString name ); ++ ~DlgToolsManageTestGroup(); ++ ++ friend class DlgToolsNewGroup; ++ ++protected: ++ QPushButton *close, *nw, *del, *add, *remove; ++ OdbcTest *pOdbcTest; ++ QComboBox *test_source; ++ QComboBox *group; ++ QLabel *l_group, *l_auto, *l_sauto; ++ QListWidget *auto_list, *sauto_list; ++ ++ void update_test_lists( void ); ++ ++protected slots: ++ void Activated( int index ); ++ void Activated( const QString &str ); ++ void Ok(); ++ void Add(); ++ void Remove(); ++ void New(); ++ void Delete(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsNewGroup.cpp b/unixODBC-2.3.7/tests/DlgToolsNewGroup.cpp +new file mode 100644 +index 0000000..093343e +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsNewGroup.cpp +@@ -0,0 +1,96 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsNewGroup.h" ++#include "DlgToolsManageTestGroup.h" ++#include "OdbcTest.h" ++ ++DlgToolsNewGroup::DlgToolsNewGroup( OdbcTest *pOdbcTest, QString name, DlgToolsManageTestGroup *ptest ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ parent_test = ptest; ++ ++ cancel = new QPushButton( "Close", this ); ++ cancel->setGeometry( 200,50, 70,25 ); ++ ++ ok = new QPushButton( "Ok", this ); ++ ok->setGeometry( 110,50, 70,25 ); ++ ++ source = new QLineEdit( this ); ++ source->setGeometry( 100, 20, 250, 20 ); ++ source->setMaxLength( 128 ); ++ ++ l_dsn = new QLabel( "Test Group:", this ); ++ l_dsn->setGeometry( 10, 20, 90, 20 ); ++ ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++} ++ ++DlgToolsNewGroup::~DlgToolsNewGroup() ++{ ++ delete cancel; ++ delete ok; ++ delete source; ++ delete l_dsn; ++} ++ ++void DlgToolsNewGroup::Ok() ++{ ++ // sanity check... ++ QString stringGroup = source->text(); ++ if ( stringGroup.isEmpty() ) ++ return; ++ ++ // add to GROUPS (but only if it it is not already there)... ++ pOdbcTest->pSettings->beginGroup( "GROUPS" ); ++ if ( pOdbcTest->pSettings->contains( stringGroup ) ) ++ { ++ ++ QMessageBox::critical( this, "OdbcTest", QString( tr("Group (%1) already defined") ).arg( stringGroup ) ); ++ pOdbcTest->pSettings->endGroup(); ++ return; ++ } ++ pOdbcTest->pSettings->setValue( stringGroup, "Installed" ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // create the group itself (it is just an empty section)... ++ // pOdbcTest->pSettings->setValue( stringGroup ); ++ ++ // update the UI... ++ parent_test->group->addItem( stringGroup ); ++ parent_test->group->setCurrentIndex( parent_test->group->count() - 1 ); ++ parent_test->Activated( stringGroup ); ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsNewGroup.h b/unixODBC-2.3.7/tests/DlgToolsNewGroup.h +new file mode 100644 +index 0000000..ca00465 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsNewGroup.h +@@ -0,0 +1,54 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++class DlgToolsManageTestGroup; ++ ++class DlgToolsNewGroup : public QDialog ++{ ++ Q_OBJECT ++public: ++ DlgToolsNewGroup( OdbcTest *pOdbcTest, QString name, DlgToolsManageTestGroup *ptest ); ++ ~DlgToolsNewGroup(); ++ ++protected: ++ QPushButton *ok, *cancel; ++ OdbcTest *pOdbcTest; ++ QLineEdit *source; ++ QLabel *l_dsn; ++ DlgToolsManageTestGroup *parent_test; ++ ++protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsNewSource.cpp b/unixODBC-2.3.7/tests/DlgToolsNewSource.cpp +new file mode 100644 +index 0000000..cb89dac +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsNewSource.cpp +@@ -0,0 +1,91 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsNewSource.h" ++#include "DlgToolsManageTest.h" ++#include "OdbcTest.h" ++ ++DlgToolsNewSource::DlgToolsNewSource( OdbcTest *pOdbcTest, QString name, DlgToolsManageTest *ptest ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ parent_test = ptest; ++ ++ cancel = new QPushButton( "Close", this ); ++ cancel->setGeometry( 200,50, 70,25 ); ++ ++ ok = new QPushButton( "Ok", this ); ++ ok->setGeometry( 110,50, 70,25 ); ++ ++ source = new QLineEdit( this ); ++ source->setGeometry( 100, 20, 250, 20 ); ++ source->setMaxLength( 128 ); ++ ++ l_dsn = new QLabel( "Test Source:", this ); ++ l_dsn->setGeometry( 10, 20, 90, 20 ); ++ ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++} ++ ++DlgToolsNewSource::~DlgToolsNewSource() ++{ ++ delete cancel; ++ delete ok; ++ delete source; ++ delete l_dsn; ++} ++ ++void DlgToolsNewSource::Ok() ++{ ++ // sanity check... ++ QString stringSource = source->text(); ++ if ( stringSource.isEmpty() ) ++ return; ++ ++ // add it (if it does not already exist)... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ if ( pOdbcTest->pSettings->contains( stringSource ) ) ++ { ++ QMessageBox::critical( this, "OdbcTest", QString( tr( "Source (%1) already defined") ).arg( stringSource ) ); ++ pOdbcTest->pSettings->endGroup(); ++ return; ++ } ++ pOdbcTest->pSettings->setValue( stringSource, "Installed" ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // update UI... ++ parent_test->test_source->addItem( stringSource ); ++ parent_test->Activated( stringSource ); ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsNewSource.h b/unixODBC-2.3.7/tests/DlgToolsNewSource.h +new file mode 100644 +index 0000000..63b86c9 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsNewSource.h +@@ -0,0 +1,55 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++class DlgToolsManageTest; ++ ++class DlgToolsNewSource : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgToolsNewSource( OdbcTest *pOdbcTest, QString name, DlgToolsManageTest *ptest ); ++ ~DlgToolsNewSource(); ++ ++protected: ++ QPushButton *ok, *cancel; ++ OdbcTest *pOdbcTest; ++ QLineEdit *source; ++ QLabel *l_dsn; ++ DlgToolsManageTest *parent_test; ++ ++protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.cpp b/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.cpp +new file mode 100644 +index 0000000..7b216e4 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.cpp +@@ -0,0 +1,705 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "DlgToolsManageTest.h" ++#include "DlgToolsManageAutoTest.h" ++#include "DlgToolsManageTestGroup.h" ++#include "DlgToolsRunAutoTests.h" ++#include "OdbcTest.h" ++ ++#define setqbit(lpa, pos) \ ++ (lpa[((pos) / CQBITS)] |= (1 << ((pos) - (CQBITS * ((pos) / CQBITS))))) ++#define SETBIT(p1,p2) setqbit(p1,(p2)-1) ++ ++DlgToolsRunAutoTests::DlgToolsRunAutoTests( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ l_tests = new QLabel( "Auto Tests:", this ); ++ l_tests->setGeometry( 10, 15, 60, 20 ); ++ ++ tests = new QTreeWidget( this ); ++ ++ tests->setGeometry( 10, 40, 300, 150 ); ++// tests->addColumn( "Tests", -1 ); ++ tests->setRootIsDecorated( TRUE ); ++ tests->setSelectionMode( QAbstractItemView::MultiSelection ); ++// tests->setSorting( -1 ); ++ tests->header()->hide(); ++ ++ l_sources = new QLabel( "Test Sources:", this ); ++ l_sources->setGeometry( 320, 15, 80, 20 ); ++ ++ sources = new QListWidget( this ); ++ sources->setSelectionMode( QListWidget::MultiSelection ); ++ ++ sources->setGeometry( 320, 40, 150, 220 ); ++ ++ output = new QGroupBox( "Output", this ); ++ ++ output->setGeometry( 10, 200, 90, 80 ); ++ ++ b_log_file = new QCheckBox( "Log File", output ); ++ b_log_file->setGeometry( 10, 20, 70, 20 ); ++ ++ b_screen = new QCheckBox( "Screen", output ); ++ b_screen->setGeometry( 10, 50, 70, 20 ); ++ b_screen->setChecked( TRUE ); ++ ++ options = new QGroupBox( "Options", this ); ++ ++ options->setGeometry( 110, 200, 200, 80 ); ++ ++ b_debug = new QCheckBox( "Debug", options ); ++ b_debug->setGeometry( 10, 20, 80, 20 ); ++ ++ b_isolate = new QCheckBox( "Isolate tests", options ); ++ b_isolate->setGeometry( 10, 50, 100, 20 ); ++ ++ b_cursor = new QCheckBox( "Cursor Library", options ); ++ b_cursor->setGeometry( 90, 20, 100, 20 ); ++ b_cursor->setTristate( TRUE ); ++ ++ run_list = new QPushButton( "Run List...", this ); ++ run_list->setGeometry( 10, 290, 70, 25 ); ++ run_list->setEnabled( FALSE ); ++ ++ rlist = new QComboBox( this ); ++ rlist->setGeometry( 100, 290, 150, 20 ); ++ rlist->insertItem( 0, "" ); ++ rlist->setEnabled( FALSE ); ++ ++ ok = new QPushButton( "Ok", this ); ++ ok->setGeometry( 320, 290, 70, 25 ); ++ ok->setEnabled( FALSE ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 400, 290, 70, 25 ); ++ ++ log_file = new QPushButton( "Log File...", this ); ++ log_file->setGeometry( 10, 320, 70, 25 ); ++ log_file->setEnabled( FALSE ); ++ ++ l_log = new QLabel( "auto.log", this ); ++ l_log->setGeometry( 89, 320, 380, 20 ); ++ l_log->setEnabled( FALSE ); ++ ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ ++ connect( log_file, SIGNAL(clicked()), SLOT(Log()) ); ++ ++ connect( b_log_file, SIGNAL(stateChanged(int)), SLOT(LogChanged(int))); ++ ++ cursor_state = SQL_CUR_USE_DRIVER; ++ connect( b_cursor, SIGNAL(stateChanged(int)), SLOT(CursorChanged(int))); ++ ++ connect( sources, SIGNAL(selectionChanged()), SLOT(TestsChanged())); ++ connect( tests, SIGNAL(selectionChanged()), SLOT(TestsChanged())); ++ ++ // load list... ++ pOdbcTest->pSettings->beginGroup( "SQL_DRIVERS" ); ++ sources->addItems( pOdbcTest->pSettings->allKeys() ); ++ sources->addItem( "ODBC Test Handles" ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // load treeview... ++ { ++ QTreeWidgetItem *top = NULL; ++ QTreeWidgetItem *last_test = NULL; ++ ++ // load treeview with all "Auto Tests"... ++ { ++ // get all "Auto Tests"... ++ pOdbcTest->pSettings->beginGroup( "Auto Tests" ); ++ QStringList stringlistAutoTests = pOdbcTest->pSettings->allKeys(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ top = new QTreeWidgetItem( tests, top ); ++ top->setText( 0, "All" ); ++ last_test = NULL ; ++ ++ // load treeview with all tests... ++ foreach( QString stringAutoTest, stringlistAutoTests ) ++ { ++ add_auto_test( stringAutoTest, top, &last_test ); ++ } ++ } ++ ++ // load treeview with all "GROUPS"... ++ { ++ // get all "GROUPS"... ++ pOdbcTest->pSettings->beginGroup( "GROUPS" ); ++ QStringList stringlistGroups = pOdbcTest->pSettings->allKeys(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ foreach( QString stringGroup, stringlistGroups ) ++ { ++ // get all tests in group... ++ pOdbcTest->pSettings->beginGroup( stringGroup ); ++ QStringList stringlistTests = pOdbcTest->pSettings->allKeys(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ top = new QTreeWidgetItem( tests, top ); ++ top->setText( 0, stringGroup ); ++ last_test = NULL ; ++ ++ // load treeview with all tests in group... ++ foreach( QString stringTest, stringlistTests ) ++ { ++ add_auto_test( stringTest, top, &last_test ); ++ } ++ } ++ } ++ } ++} ++ ++DlgToolsRunAutoTests::~DlgToolsRunAutoTests() ++{ ++ // sync settings with disk (mostly means 'save changes') ++ { ++ pOdbcTest->pSettings->sync(); ++ QSettings::Status nStatus = pOdbcTest->pSettings->status(); ++ switch ( nStatus ) ++ { ++ case QSettings::AccessError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("AccessError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::FormatError: ++ QMessageBox::critical( pOdbcTest, "OdbcTest", QString( tr("FormatError when sync() settings to %1") ).arg( pOdbcTest->pSettings->fileName() ) ); ++ break; ++ case QSettings::NoError: ++ default: ++ break; ++ } ++ } ++ ++ delete l_tests; ++ delete tests; ++ delete l_sources; ++ delete sources; ++ delete output; ++ delete options; ++ delete run_list; ++ delete rlist; ++ delete ok; ++ delete cancel; ++ delete log_file; ++ delete l_log; ++} ++ ++/*! ++ * \brief Run the tests. ++ * ++ * For each selected Source (SQL_DRIVER) run selected Tests (Auto Tests). The ++ * Sources are processed in the order found in the UI. The Tests are also ++ * processed in the order found in the UI. The Groups (of tests) are processed ++ * last. One should find that the order reflects the order of things in the ++ * settings file. ++ * ++ */ ++void DlgToolsRunAutoTests::Ok() ++{ ++ SQLHWND hWnd = NULL; ++ ++#ifdef WIN32 ++ hWnd = (SQLHWND)pOdbcTest->out_win; ++#else ++ ++ /* ++ * Init a ODBCINSTWND ++ * --- ++ * ++ * This is for SERVERINFO::hwnd. ++ * ++ * We use a generic handle (ODBCINSTWND) and specify a Qt4 graphical user interface (odbcinstQ4). ++ * ++ * The odbcinstQ4 library provides the Qt4 graphical user interface for things like SQLCreateDataSource ++ * and provides szLogPrintf/szMessageBox. The odbcinstQ4 library is a plugin which is loaded by the ++ * odbcinst library (and some others) as needed - it should NOT be used directly by this application ++ * or by any of the test libraries. The test libraries should never need to interpret SERVERINFO::hwnd - ++ * they should simply pass it on wherever needed. ++ * ++ * This application and test libraries should link to the odbcinst library to get szLogPrintf and ++ * szMessageBox. ++ * ++ * NOTE ++ * ++ * It is bad form to have auto tests rely upon any user interaction so a test library which needs ++ * a viable hwnd should not really happen (not even for SQLDriverConnect). However; szLogPrintf and ++ * szMessageBox will use it internally. ++ * ++ * On MS'sm the szLogPrintf and szMessageBox are found in the gtrtst (gator test) library. Here; we ++ * get it via the odbcinst library. ++ * ++ */ ++ ODBCINSTWND Wnd; ++ ++ strcpy( Wnd.szUI, "odbcinstQ4" ); // UI plugin to use (Qt4). ++ Wnd.hWnd = pOdbcTest->out_win; // Output window for szLogPrintf and szMessageBox. ++ hWnd = (SQLHWND)(&Wnd); ++#endif ++ ++ /* ++ * Init a SERVERINFO ++ * --- ++ * ++ * More refinements are done as we process. ++ * ++ */ ++ SERVERINFO ServerInfo; ++ ++ ServerInfo.cBuff = 0; ++ ServerInfo.cErrors = 0; ++ ServerInfo.failed = 0; ++ ServerInfo.fDebug = ( b_debug->isChecked() ? true : false ); ++ ServerInfo.fIsolate = ( b_isolate->isChecked() ? true : false ); ++ ServerInfo.fLog = ( b_log_file->isChecked() ? true : false ); ++ ServerInfo.fScreen = ( b_screen->isChecked() ? true : false ); ++ ServerInfo.hdbc = SQL_NULL_HANDLE; ++ ServerInfo.henv = SQL_NULL_HANDLE; ++ ServerInfo.hLoadedInst = NULL; ++ ServerInfo.hstmt = SQL_NULL_HANDLE; ++ ServerInfo.hwnd = hWnd; ++ ServerInfo.rglMask = NULL; ++ *(ServerInfo.szBuff) = '\0'; ++ *(ServerInfo.szKeywords) = '\0'; ++ *(ServerInfo.szLogFile) = '\0'; ++ *(ServerInfo.szSource) = '\0'; ++ *(ServerInfo.szValidLogin0) = '\0'; ++ *(ServerInfo.szValidPassword0) = '\0'; ++ *(ServerInfo.szValidServer0) = '\0'; ++ ServerInfo.vCursorLib = cursor_state; ++ ++ if ( b_log_file->isChecked() ) strcpy( ServerInfo.szLogFile, l_log->text().toUtf8().constData() ); ++ ++ // do it ++ runSources( &ServerInfo ); ++} ++ ++void DlgToolsRunAutoTests::Log() ++{ ++ // allow User to select a file... ++ QFileDialog dlg( this ); ++ ++ dlg.setFileMode( QFileDialog::AnyFile ); ++ dlg.selectFile( l_log->text() ); ++ ++ if ( dlg.exec() == QDialog::Accepted ) ++ { ++ QString result = dlg.selectedFiles().at( 0 ); ++ l_log->setText( result ); ++ } ++} ++ ++void DlgToolsRunAutoTests::LogChanged( int state ) ++{ ++ if ( state ) ++ { ++ log_file->setEnabled( TRUE ); ++ l_log->setEnabled( TRUE ); ++ } ++ else ++ { ++ log_file->setEnabled( FALSE ); ++ l_log->setEnabled( FALSE ); ++ } ++} ++ ++void DlgToolsRunAutoTests::CursorChanged( int state ) ++{ ++ if ( state == 0 ) ++ { ++ cursor_state = SQL_CUR_USE_DRIVER; ++ } ++ else if ( state == 1 ) ++ { ++ cursor_state = SQL_CUR_USE_IF_NEEDED; ++ } ++ else if ( state == 1 ) ++ { ++ cursor_state = SQL_CUR_USE_ODBC; ++ } ++} ++ ++void DlgToolsRunAutoTests::add_auto_test( const QString &stringTest, QTreeWidgetItem *top, QTreeWidgetItem **item ) ++{ ++ // get test library file name... ++ pOdbcTest->pSettings->beginGroup( stringTest ); ++ QString stringTestFileName = pOdbcTest->pSettings->value( "DLL" ).toString(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ if ( stringTestFileName.isEmpty() ) ++ return; ++ ++ // load test library... ++ QLibrary libraryTest( stringTestFileName ); ++ ++ if ( !libraryTest.isLoaded() ) ++ return; ++ ++ // get our entry points... ++ AUTOTESTNAME pAutoTestName = (AUTOTESTNAME)libraryTest.resolve( "AutoTestName" ); ++ AUTOTESTDESC pAutoTestDesc = (AUTOTESTDESC)libraryTest.resolve( "AutoTestDesc" ); ++ AUTOTESTFUNC pAutoTestFunc = (AUTOTESTFUNC)libraryTest.resolve( "AutoTestFunc" ); ++ ++ if ( !pAutoTestName || !pAutoTestDesc || !pAutoTestFunc ) ++ return; ++ ++ // get test name, number of test cases... ++ char szTest[ AUTO_MAX_TEST_NAME + 1 ]; ++ UINT nTestCases; ++ ++ if ( !pAutoTestName( szTest, &nTestCases ) ) ++ return; ++ ++ // add test... ++ QTreeWidgetItem *ptreewidgetitemTest = *item = new QTreeWidgetItem( top, *item ); ++ ptreewidgetitemTest->setText( 0, szTest ); ++ ++ // add test cases... ++ QTreeWidgetItem *ptreewidgetitemTestCase = NULL; ++ ++ for ( UWORD i = 1; i <= nTestCases; i ++ ) ++ { ++ // get test case details... ++ char szTestCase[ AUTO_MAX_TESTCASE_NAME + 1 ]; ++ char szTestCaseDesc[ AUTO_MAX_TESTDESC_NAME + 1 ]; ++ ++ if ( !pAutoTestDesc( i, szTestCase, szTestCaseDesc ) ) ++ continue; ++ ++ // create test case tree widget item... ++ if ( ptreewidgetitemTestCase ) ++ ptreewidgetitemTestCase = new QTreeWidgetItem( ptreewidgetitemTest, ptreewidgetitemTestCase ); ++ else ++ ptreewidgetitemTestCase = new QTreeWidgetItem( ptreewidgetitemTest ); ++ ++ ptreewidgetitemTestCase->setText( 0, szTestCase ); ++ ptreewidgetitemTestCase->setText( 1, szTestCaseDesc ); ++ } ++} ++ ++void DlgToolsRunAutoTests::runSources( SERVERINFO *pServerInfo ) ++{ ++ // for each selected source (SQL_DRIVER)... ++ foreach( QListWidgetItem *pListWidgetItem, sources->selectedItems() ) ++ { ++ QString stringSource = pListWidgetItem->text(); ++ ++ // init some SERVERINFO stuff... ++ strcpy( pServerInfo->szSource, stringSource.toUtf8().constData() ); ++ ++ pOdbcTest->pSettings->beginGroup( stringSource ); ++ strcpy( pServerInfo->szValidServer0, pOdbcTest->pSettings->value( "SERVER0" ).toString().toUtf8().constData() ); ++ strcpy( pServerInfo->szValidLogin0, pOdbcTest->pSettings->value( "LOGIN0" ).toString().toUtf8().constData() ); ++ strcpy( pServerInfo->szValidPassword0, pOdbcTest->pSettings->value( "PASSWORD0" ).toString().toUtf8().constData() ); ++ strcpy( pServerInfo->szKeywords, pOdbcTest->pSettings->value( "KEYWORDS" ).toString().toUtf8().constData() ); ++ pOdbcTest->pSettings->endGroup(); ++ ++ // do it... ++ runGroups( pServerInfo, stringSource ); ++ } ++} ++ ++void DlgToolsRunAutoTests::runGroups( SERVERINFO *pServerInfo, const QString &stringSource ) ++{ ++ // process groups (1st level in tree)... ++ QTreeWidgetItem *ptreewidgetitemGroup = NULL; ++ ++ for ( int n = 0; (ptreewidgetitemGroup = tests->topLevelItem( n )); n++ ) ++ { ++ if ( !ptreewidgetitemGroup->isSelected() ) ++ continue; ++ ++ // init/reinit some SERVERINFO stuff (reinit in case test messed with it)... ++ if ( stringSource == "ODBC Test Handles" ) ++ { ++ pServerInfo->henv = pOdbcTest->get_handle( SQL_HANDLE_ENV ); ++ pServerInfo->hdbc = pOdbcTest->get_handle( SQL_HANDLE_DBC ); ++ pServerInfo->hstmt = pOdbcTest->get_handle( SQL_HANDLE_STMT ); ++ ++ } ++ else ++ { ++ pServerInfo->henv = NULL; ++ pServerInfo->hdbc = NULL; ++ pServerInfo->hstmt = NULL; ++ } ++ ++ // kick out some progress info... ++ QString stringGroup = ptreewidgetitemGroup->text( 0 ); ++ QString stringMessage; ++ ++ stringMessage = QString( tr("Now executing Group %1 on source %2") ).arg( stringGroup ).arg( stringSource ); // we format the message here so we can use tr() ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ stringMessage = QString( tr("Keywords: %1") ).arg( pServerInfo->szKeywords ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ ++ // do it... ++ runTests( pServerInfo, ptreewidgetitemGroup ); ++ } ++} ++ ++void DlgToolsRunAutoTests::runTests( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemGroup ) ++{ ++ // process tests (2nd level in tree)... ++ QTreeWidgetItem *ptreewidgetitemTest = NULL; ++ ++ for ( int n = 0; (ptreewidgetitemTest = ptreewidgetitemGroup->child( n )); n++ ) ++ { ++ if ( !ptreewidgetitemTest->isSelected() ) ++ continue; ++ ++ // dot it... ++ runTest( pServerInfo, ptreewidgetitemTest ); ++ } ++} ++ ++void DlgToolsRunAutoTests::runTest( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemTest ) ++{ ++ QString stringTest = ptreewidgetitemTest->text( 0 ); ++ QString stringMessage; ++ ++ // get test library file name... ++ pOdbcTest->pSettings->beginGroup( stringTest ); ++ QString stringTestFileName = pOdbcTest->pSettings->value( "DLL" ).toString(); ++ pOdbcTest->pSettings->endGroup(); ++ ++ if ( stringTestFileName.isEmpty() ) ++ { ++ stringMessage = QString( tr("Failed to find library name (DLL) in settings for %1 test.") ).arg( stringTest ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ return; ++ } ++ ++ // kick out some progress info... ++ stringMessage = QString( tr("Now Executing Auto Test: %1") ).arg( stringTest ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ stringMessage = QString( tr("Time started %1") ).arg( QTime::currentTime().toString() ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ ++ // load test library... ++ QLibrary libraryTest( stringTestFileName ); ++ ++ if ( !libraryTest.isLoaded() ) ++ { ++ stringMessage = QString( tr("Failed to load test library %1") ).arg( stringTestFileName ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ return; ++ } ++ ++ // get our entry points... ++ AUTOTESTNAME pAutoTestName = (AUTOTESTNAME)libraryTest.resolve( "AutoTestName" ); ++ AUTOTESTFUNC pAutoTestFunc = (AUTOTESTFUNC)libraryTest.resolve( "AutoTestFunc" ); ++ ++ if ( !pAutoTestFunc ) ++ { ++ stringMessage = QString( tr("Failed to resolve AutoTestFunc in library %1") ).arg( stringTestFileName ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ return; ++ } ++ ++ if ( !pAutoTestName ) ++ { ++ stringMessage = QString( tr("Failed to resolve AutoTestName in library %1") ).arg( stringTestFileName ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ return; ++ } ++ ++ // get test name and number of test cases... ++ char szTest[ AUTO_MAX_TEST_NAME + 1 ]; ++ UINT nTestCases; ++ ++ if ( !pAutoTestName( szTest, &nTestCases ) ) ++ { ++ stringMessage = tr("AutoTestName returns FALSE"); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ return; ++ } ++ ++ // do it... ++ runTestCases( pServerInfo, ptreewidgetitemTest, pAutoTestFunc, nTestCases ); ++ ++ // ++ stringMessage = QString( tr("Time finished %s") ).arg( QTime::currentTime().toString() ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++} ++ ++void DlgToolsRunAutoTests::runTestCases( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemTest, AUTOTESTFUNC pAutoTestFunc, UINT nTestCases ) ++{ ++ QString stringMessage; ++ int size; ++ ++ size = nTestCases / (sizeof(unsigned int)*8); ++ size ++; ++ ++ // init mask... ++ pServerInfo->rglMask = (UINT FAR *)calloc( sizeof(unsigned int), size ); ++ ++ // for each test case call into test library... ++ if ( b_isolate->isChecked()) ++ { ++ QTreeWidgetItem *ptreewidgetitemTestCase = NULL; ++ ++ for ( int n = 0; (ptreewidgetitemTestCase = ptreewidgetitemTest->child( n )); n++ ) ++ { ++ if ( ptreewidgetitemTestCase->isSelected()) ++ { ++ SETBIT( pServerInfo->rglMask, ptreewidgetitemTest->indexOfChild( ptreewidgetitemTestCase ) ); ++ pAutoTestFunc( pServerInfo ); ++ } ++ } ++ } ++ // call into test library once... ++ else ++ { ++ QTreeWidgetItem *ptreewidgetitemTestCase = NULL; ++ ++ memset( pServerInfo->rglMask, 0, sizeof(unsigned int) * size ); ++ ++ for ( int n = 0; (ptreewidgetitemTestCase = ptreewidgetitemTest->child( n )); n++ ) ++ { ++ if ( ptreewidgetitemTestCase->isSelected()) ++ { ++ SETBIT(pServerInfo->rglMask, ptreewidgetitemTest->indexOfChild( ptreewidgetitemTestCase ) ); ++ } ++ } ++ pAutoTestFunc( pServerInfo ); ++ } ++ ++ // errors? ++ stringMessage = QString( tr("Error Count: %1") ).arg( pServerInfo->cErrors ); ++ szLogPrintf( pServerInfo, false, stringMessage.toLatin1().data() ); ++ ++ // fini mask... ++ free( pServerInfo->rglMask ); ++} ++ ++void DlgToolsRunAutoTests::TestsChanged() ++{ ++ int ok1 = 0, ok2 = 0; ++ ++ // are any of the sources selected? ++ { ++ /* ++ for ( int i = 0; i < sources->count(); i ++ ) ++ { ++ if ( sources->isSelected( i ) ) ++ { ++ ok1 = 1; ++ break; ++ } ++ } ++ */ ++ if ( sources->selectedItems().count() ) ++ ok1 = 1; ++ } ++ ++ // are any of the tests selected? ++ { ++ /* ++ QTreeWidgetItem *group = (QTreeWidgetItem*) tests->firstChild(); ++ while( group ) ++ { ++ if ( group->isSelected()) ++ { ++ ok2 = 1; ++ break; ++ } ++ group = group->nextSibling(); ++ } ++ */ ++ if ( tests->selectedItems().count() ) ++ ok2 = 1; ++ } ++ ++ // ++ if ( ok1 && ok2 ) ++ { ++ ok->setEnabled( TRUE ); ++ } ++ else ++ { ++ ok->setEnabled( FALSE ); ++ } ++} ++ ++void OdbcTest::slotOptions() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotTrace() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotManageTestSources() ++{ ++ DlgToolsManageTest *dlg = new DlgToolsManageTest( this, "Manage Test Sources" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotManageAutoTests() ++{ ++ DlgToolsManageAutoTest *dlg = new DlgToolsManageAutoTest( this, "Manage Auto Test" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotManageTestGroups() ++{ ++ DlgToolsManageTestGroup *dlg = new DlgToolsManageTestGroup( this, "Manage Test Groups" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotRunAutoTests() ++{ ++ DlgToolsRunAutoTests *dlg = new DlgToolsRunAutoTests( this, "Run Auto Tests" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ +diff --git a/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.h b/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.h +new file mode 100644 +index 0000000..4cf52ee +--- /dev/null ++++ b/unixODBC-2.3.7/tests/DlgToolsRunAutoTests.h +@@ -0,0 +1,73 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class DlgToolsRunAutoTests : public QDialog ++{ ++ Q_OBJECT ++ ++public: ++ DlgToolsRunAutoTests( OdbcTest *pOdbcTest, QString name ); ++ ~DlgToolsRunAutoTests(); ++ ++protected: ++ QPushButton *run_list, *ok, *cancel, *log_file; ++ OdbcTest *pOdbcTest; ++ QComboBox *rlist; ++ QLabel *l_tests, *l_sources, *l_log; ++ QGroupBox *output, *options; ++ QListWidget *sources; ++ QTreeWidget *tests; ++ QCheckBox *b_log_file, *b_screen, *b_debug, *b_isolate, *b_cursor; ++ ++ void add_auto_test( const QString &stringTest, QTreeWidgetItem *top, QTreeWidgetItem **last_test ); ++ ++protected slots: ++ void Ok(); ++ void Log(); ++ void LogChanged(int); ++ void CursorChanged(int); ++ void TestsChanged(); ++ ++private: ++ int cursor_state; ++ ++ void runSources( SERVERINFO *pServerInfo ); ++ void runGroups( SERVERINFO *pServerInfo, const QString &stringSource ); ++ void runTests( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemGroup ); ++ void runTest( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemTest ); ++ void runTestCases( SERVERINFO *pServerInfo, QTreeWidgetItem *ptreewidgetitemTest, AUTOTESTFUNC pAutoTestFunc, UINT nTestCases ); ++}; ++ ++ ++ +diff --git a/unixODBC-2.3.7/tests/Makefile.am b/unixODBC-2.3.7/tests/Makefile.am +new file mode 100644 +index 0000000..c650e3e +--- /dev/null ++++ b/unixODBC-2.3.7/tests/Makefile.am +@@ -0,0 +1,184 @@ ++bin_PROGRAMS = ODBCTestQ4 ++ ++INCLUDES = $(QT_CXXFLAGS) \ ++ $(INCLUDES_COMMON) \ ++ -DSYSTEM_FILE_PATH=\"@sysconfdir@\" \ ++ $(LTDLINCL) ++ ++ODBCTestQ4_LDADD = \ ++ $(QT_LDFLAGS) \ ++ $(QT_LIBS) \ ++ ../gtrtstQ4/libgtrtstQ4.la \ ++ -lodbc -lodbcinst ++ ++ODBCTestQ4_SOURCES = \ ++ attr.cpp \ ++ catalog.cpp \ ++ conn.cpp \ ++ desc.cpp \ ++ diag.cpp \ ++ DlgDbcConnect.cpp \ ++ DlgEnvAllocEnv.cpp \ ++ DlgEnvAllocHandle.cpp \ ++ DlgEnvDataSources.cpp \ ++ DlgEnvDrivers.cpp \ ++ DlgEnvEndTran.cpp \ ++ DlgEnvFreeEnv.cpp \ ++ DlgEnvFreeHandle.cpp \ ++ DlgEnvTransact.cpp \ ++ DlgToolsManageAutoTest.cpp \ ++ DlgToolsManageTest.cpp \ ++ DlgToolsManageTestGroup.cpp \ ++ DlgToolsNewGroup.cpp \ ++ DlgToolsNewSource.cpp \ ++ DlgToolsRunAutoTests.cpp \ ++ installer.cpp \ ++ main.cpp \ ++ OdbcHandle.cpp \ ++ OdbcTest.cpp \ ++ results.cpp \ ++ stmt.cpp \ ++ mattr.cpp \ ++ mcatalog.cpp \ ++ mconn.cpp \ ++ mdesc.cpp \ ++ mdiag.cpp \ ++ mDlgDbcConnect.cpp \ ++ mDlgToolsManageAutoTest.cpp \ ++ mDlgToolsManageTest.cpp \ ++ mDlgToolsManageTestGroup.cpp \ ++ mDlgToolsNewGroup.cpp \ ++ mDlgToolsNewSource.cpp \ ++ mDlgToolsRunAutoTests.cpp \ ++ mDlgEnvAllocEnv.cpp \ ++ mDlgEnvAllocHandle.cpp \ ++ mDlgEnvDataSources.cpp \ ++ mDlgEnvDrivers.cpp \ ++ mDlgEnvEndTran.cpp \ ++ mDlgEnvFreeEnv.cpp \ ++ mDlgEnvFreeHandle.cpp \ ++ mDlgEnvTransact.cpp \ ++ mOdbcTest.cpp \ ++ mresults.cpp \ ++ mstmt.cpp ++ ++mresults.cpp: @srcdir@/results.h ++ @MOC@ @srcdir@/results.h -o mresults.cpp ++ ++mstmt.cpp: @srcdir@/stmt.h ++ @MOC@ @srcdir@/stmt.h -o mstmt.cpp ++ ++mOdbcTest.cpp: @srcdir@/OdbcTest.h ++ @MOC@ @srcdir@/OdbcTest.h -o mOdbcTest.cpp ++ ++mdesc.cpp: @srcdir@/desc.h ++ @MOC@ @srcdir@/desc.h -o mdesc.cpp ++ ++mdiag.cpp: @srcdir@/diag.h ++ @MOC@ @srcdir@/diag.h -o mdiag.cpp ++ ++mDlgEnvAllocEnv.cpp: @srcdir@/DlgEnvAllocEnv.h ++ @MOC@ @srcdir@/DlgEnvAllocEnv.h -o mDlgEnvAllocEnv.cpp ++ ++mDlgEnvAllocHandle.cpp: @srcdir@/DlgEnvAllocHandle.h ++ @MOC@ @srcdir@/DlgEnvAllocHandle.h -o mDlgEnvAllocHandle.cpp ++ ++mDlgEnvDataSources.cpp: @srcdir@/DlgEnvDataSources.h ++ @MOC@ @srcdir@/DlgEnvDataSources.h -o mDlgEnvDataSources.cpp ++ ++mDlgEnvDrivers.cpp: @srcdir@/DlgEnvDrivers.h ++ @MOC@ @srcdir@/DlgEnvDrivers.h -o mDlgEnvDrivers.cpp ++ ++mDlgEnvEndTran.cpp: @srcdir@/DlgEnvEndTran.h ++ @MOC@ @srcdir@/DlgEnvEndTran.h -o mDlgEnvEndTran.cpp ++ ++mDlgEnvFreeEnv.cpp: @srcdir@/DlgEnvFreeEnv.h ++ @MOC@ @srcdir@/DlgEnvFreeEnv.h -o mDlgEnvFreeEnv.cpp ++ ++mDlgEnvFreeHandle.cpp: @srcdir@/DlgEnvFreeHandle.h ++ @MOC@ @srcdir@/DlgEnvFreeHandle.h -o mDlgEnvFreeHandle.cpp ++ ++mDlgEnvTransact.cpp: @srcdir@/DlgEnvTransact.h ++ @MOC@ @srcdir@/DlgEnvTransact.h -o mDlgEnvTransact.cpp ++ ++mcatalog.cpp: @srcdir@/catalog.h ++ @MOC@ @srcdir@/catalog.h -o mcatalog.cpp ++ ++mconn.cpp: @srcdir@/conn.h ++ @MOC@ @srcdir@/conn.h -o mconn.cpp ++ ++mattr.cpp: @srcdir@/attr.h ++ @MOC@ @srcdir@/attr.h -o mattr.cpp ++ ++mDlgDbcConnect.cpp: @srcdir@/DlgDbcConnect.h ++ @MOC@ @srcdir@/DlgDbcConnect.h -o mDlgDbcConnect.cpp ++ ++mDlgToolsManageAutoTest.cpp: @srcdir@/DlgToolsManageAutoTest.h ++ @MOC@ @srcdir@/DlgToolsManageAutoTest.h -o mDlgToolsManageAutoTest.cpp ++ ++mDlgToolsManageTest.cpp: @srcdir@/DlgToolsManageTest.h ++ @MOC@ @srcdir@/DlgToolsManageTest.h -o mDlgToolsManageTest.cpp ++ ++mDlgToolsManageTestGroup.cpp: @srcdir@/DlgToolsManageTestGroup.h ++ @MOC@ @srcdir@/DlgToolsManageTestGroup.h -o mDlgToolsManageTestGroup.cpp ++ ++mDlgToolsNewGroup.cpp: @srcdir@/DlgToolsNewGroup.h ++ @MOC@ @srcdir@/DlgToolsNewGroup.h -o mDlgToolsNewGroup.cpp ++ ++mDlgToolsNewSource.cpp: @srcdir@/DlgToolsNewSource.h ++ @MOC@ @srcdir@/DlgToolsNewSource.h -o mDlgToolsNewSource.cpp ++ ++mDlgToolsRunAutoTests.cpp: @srcdir@/DlgToolsRunAutoTests.h ++ @MOC@ @srcdir@/DlgToolsRunAutoTests.h -o mDlgToolsRunAutoTests.cpp ++ ++CLEANFILES = \ ++ mattr.cpp \ ++ mcatalog.cpp \ ++ mconn.cpp \ ++ mdesc.cpp \ ++ mdiag.cpp \ ++ mDlgDbcConnect.cpp \ ++ mDlgEnvAllocEnv.cpp \ ++ mDlgEnvAllocHandle.cpp \ ++ mDlgEnvDataSources.cpp \ ++ mDlgEnvDrivers.cpp \ ++ mDlgEnvEndTran.cpp \ ++ mDlgEnvFreeEnv.cpp \ ++ mDlgEnvFreeHandle.cpp \ ++ mDlgEnvTransact.cpp \ ++ mDlgToolsManageAutoTest.cpp \ ++ mDlgToolsManageTest.cpp \ ++ mDlgToolsManageTestGroup.cpp \ ++ mDlgToolsNewGroup.cpp \ ++ mDlgToolsNewSource.cpp \ ++ mDlgToolsRunAutoTests.cpp \ ++ mOdbcTest.cpp \ ++ mresults.cpp \ ++ mstmt.cpp ++ ++EXTRA_DIST = \ ++ attr.h \ ++ catalog.h \ ++ conn.h \ ++ desc.h \ ++ diag.h \ ++ DlgDbcConnect.h \ ++ DlgEnvAllocEnv.h \ ++ DlgEnvAllocHandle.h \ ++ DlgEnvDataSources.h \ ++ DlgEnvDrivers.h \ ++ DlgEnvEndTran.h \ ++ DlgEnvFreeEnv.h \ ++ DlgEnvFreeHandle.h \ ++ DlgEnvTransact.h \ ++ DlgToolsManageAutoTest.h \ ++ DlgToolsManageTest.h \ ++ DlgToolsManageTestGroup.h \ ++ DlgToolsNewGroup.h \ ++ DlgToolsNewSource.h \ ++ DlgToolsRunAutoTests.h \ ++ OdbcHandle.h \ ++ OdbcTest.h \ ++ results.h \ ++ stmt.h ++ +diff --git a/unixODBC-2.3.7/tests/ODBCTestQ5-48.xpm b/unixODBC-2.3.7/tests/ODBCTestQ5-48.xpm +new file mode 100644 +index 0000000..2e93592 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/ODBCTestQ5-48.xpm +@@ -0,0 +1,453 @@ ++/* XPM */ ++static const char * xpmODBCTestQ5_48[] = { ++"48 48 402 2", ++" c None", ++". c #974C2E", ++"+ c #9A4D2F", ++"@ c #9C4F31", ++"# c #9D5032", ++"$ c #9D4F31", ++"% c #9C4E30", ++"& c #994E2F", ++"* c #954F30", ++"= c #B3130A", ++"- c #CC1E1E", ++"; c #D01F1F", ++"> c #D21F1F", ++", c #D52A2A", ++"' c #D42323", ++") c #D31F1F", ++"! c #CC2121", ++"~ c #9F2812", ++"{ c #B80E06", ++"] c #CA0000", ++"^ c #CF0000", ++"/ c #D20202", ++"( c #E87E7E", ++"_ c #F6D0D0", ++": c #E88181", ++"< c #D20000", ++"[ c #CB0101", ++"} c #A22610", ++"| c #BC0E06", ++"1 c #CE0000", ++"2 c #D50202", ++"3 c #E14545", ++"4 c #F1A3A3", ++"5 c #E24C4C", ++"6 c #D60000", ++"7 c #D40000", ++"8 c #D00101", ++"9 c #A7240F", ++"0 c #C00E06", ++"a c #D50404", ++"b c #EE9898", ++"c c #FEFAFA", ++"d c #FEFEFE", ++"e c #F7CECE", ++"f c #E24242", ++"g c #D70000", ++"h c #D40101", ++"i c #AB240E", ++"j c #973116", ++"k c #C63A35", ++"l c #C40E06", ++"m c #D50000", ++"n c #E35454", ++"o c #F4B9B9", ++"p c #F9D9D9", ++"q c #FCEDED", ++"r c #FAE1E1", ++"s c #DB0303", ++"t c #D80101", ++"u c #AF250F", ++"v c #9D351A", ++"w c #C82F2C", ++"x c #C80503", ++"y c #CF0909", ++"z c #DA3435", ++"A c #C74237", ++"B c #C90E06", ++"C c #D90101", ++"D c #ED8B8B", ++"E c #FBE6E6", ++"F c #DF2F2F", ++"G c #F19F9F", ++"H c #F3ADAD", ++"I c #EE8787", ++"J c #DD0707", ++"K c #DC0101", ++"L c #B4250F", ++"M c #C6261E", ++"N c #D41919", ++"O c #CE0808", ++"P c #C3231C", ++"Q c #B11E0C", ++"R c #D40202", ++"S c #D90000", ++"T c #DB0000", ++"U c #DF1010", ++"V c #E53D3D", ++"W c #C23F2E", ++"X c #CF0E06", ++"Y c #DE0606", ++"Z c #E86060", ++"` c #E34A4A", ++" . c #FCEEEE", ++".. c #E86363", ++"+. c #E01C1C", ++"@. c #DF0101", ++"#. c #E00101", ++"$. c #BE210E", ++"%. c #C5291B", ++"&. c #E11D1E", ++"*. c #D71515", ++"=. c #A1371B", ++"-. c #D50403", ++";. c #DE0000", ++">. c #E30000", ++",. c #E60000", ++"'. c #E70000", ++"). c #E70101", ++"!. c #E91F1F", ++"~. c #E5423E", ++"{. c #C2432E", ++"]. c #D8120A", ++"^. c #E20000", ++"/. c #E42929", ++"(. c #F5B8B8", ++"_. c #FAE3E3", ++":. c #ED8989", ++"<. c #E12828", ++"[. c #E10000", ++"}. c #E30202", ++"|. c #CC3728", ++"1. c #C3321E", ++"2. c #E6201E", ++"3. c #E70E0F", ++"4. c #DD0202", ++"5. c #D71C1B", ++"6. c #C41108", ++"7. c #DE0202", ++"8. c #ED0000", ++"9. c #F00000", ++"0. c #EF0000", ++"a. c #EE0202", ++"b. c #EF2626", ++"c. c #ED1212", ++"d. c #E80000", ++"e. c #E60909", ++"f. c #E73737", ++"g. c #F5B3B3", ++"h. c #FEFBFB", ++"i. c #EE8686", ++"j. c #DF0707", ++"k. c #EC2222", ++"l. c #EE1B1B", ++"m. c #F10000", ++"n. c #EC0000", ++"o. c #DF0E0E", ++"p. c #B82B1A", ++"q. c #AB250F", ++"r. c #D90303", ++"s. c #F20000", ++"t. c #F60000", ++"u. c #F70000", ++"v. c #F50000", ++"w. c #F40000", ++"x. c #F30000", ++"y. c #E40909", ++"z. c #E32323", ++"A. c #EE8484", ++"B. c #FEF8F8", ++"C. c #F29E9E", ++"D. c #DB1C1B", ++"E. c #C80905", ++"F. c #DA0101", ++"G. c #E50000", ++"H. c #F80000", ++"I. c #F90000", ++"J. c #EA0000", ++"K. c #E31B1B", ++"L. c #FAE0E0", ++"M. c #EC7676", ++"N. c #FDF5F5", ++"O. c #EC5656", ++"P. c #EE0000", ++"Q. c #DA0808", ++"R. c #C3221A", ++"S. c #A71F0D", ++"T. c #CF0303", ++"U. c #DA0000", ++"V. c #E40000", ++"W. c #FA0000", ++"X. c #EB0000", ++"Y. c #E11414", ++"Z. c #E44B4B", ++"`. c #F3ABAB", ++" + c #F5ABAB", ++".+ c #D80000", ++"++ c #D21919", ++"@+ c #9C3016", ++"#+ c #BE0301", ++"$+ c #E00000", ++"%+ c #E40303", ++"&+ c #DF1414", ++"*+ c #FCEBEB", ++"=+ c #EA7878", ++"-+ c #EE8E8E", ++";+ c #F5B0B0", ++">+ c #DF0000", ++",+ c #CA0202", ++"'+ c #B2150B", ++")+ c #B01709", ++"!+ c #D00000", ++"~+ c #E90000", ++"{+ c #E51C1C", ++"]+ c #F8D2D2", ++"^+ c #FEFDFD", ++"/+ c #EA7979", ++"(+ c #F0A0A0", ++"_+ c #EE7272", ++":+ c #AC1C0B", ++"<+ c #C21006", ++"[+ c #E00707", ++"}+ c #DF4040", ++"|+ c #F9DBDB", ++"1+ c #E01111", ++"2+ c #C11106", ++"3+ c #A92C12", ++"4+ c #D90301", ++"5+ c #DE0808", ++"6+ c #ED8D8D", ++"7+ c #F2B2B2", ++"8+ c #E55555", ++"9+ c #DF0404", ++"0+ c #D60602", ++"a+ c #BF1F0C", ++"b+ c #E97B7B", ++"c+ c #DC2B2B", ++"d+ c #DC1010", ++"e+ c #B52911", ++"f+ c #C92317", ++"g+ c #E30303", ++"h+ c #DE3232", ++"i+ c #E98383", ++"j+ c #F5C5C5", ++"k+ c #D50101", ++"l+ c #E51515", ++"m+ c #C04432", ++"n+ c #AC2F1A", ++"o+ c #D81E1E", ++"p+ c #DD0C0C", ++"q+ c #DD0000", ++"r+ c #D90C0C", ++"s+ c #F8D5D5", ++"t+ c #EA9090", ++"u+ c #F2B9B9", ++"v+ c #D30000", ++"w+ c #DE1C1C", ++"x+ c #DC3E3D", ++"y+ c #A64329", ++"z+ c #983017", ++"A+ c #C4231F", ++"B+ c #D11313", ++"C+ c #E14D4D", ++"D+ c #F7D9D9", ++"E+ c #DF5E5E", ++"F+ c #FAE8E8", ++"G+ c #D92D2D", ++"H+ c #D40303", ++"I+ c #D5292A", ++"J+ c #C6443D", ++"K+ c #AC261C", ++"L+ c #C51A1A", ++"M+ c #C80202", ++"N+ c #DC0000", ++"O+ c #D70101", ++"P+ c #E36262", ++"Q+ c #F3C4C4", ++"R+ c #DB5353", ++"S+ c #D21010", ++"T+ c #C80606", ++"U+ c #CC3737", ++"V+ c #AE4235", ++"W+ c #AE0706", ++"X+ c #B90909", ++"Y+ c #C00000", ++"Z+ c #C90000", ++"`+ c #D10000", ++" @ c #D83535", ++".@ c #FCF2F2", ++"+@ c #DE6D6D", ++"@@ c #F1BEBE", ++"#@ c #CC0000", ++"$@ c #BF0000", ++"%@ c #BB1313", ++"&@ c #A41B12", ++"*@ c #8D2810", ++"=@ c #B60000", ++"-@ c #C10000", ++";@ c #D31D1D", ++">@ c #E17474", ++",@ c #FBEEEE", ++"'@ c #DF7474", ++")@ c #CA0303", ++"!@ c #CD0000", ++"~@ c #B50000", ++"{@ c #AB0A04", ++"]@ c #BE0000", ++"^@ c #C70000", ++"/@ c #CC0202", ++"(@ c #D12A2A", ++"_@ c #D44545", ++":@ c #EFBABA", ++"<@ c #EAA4A4", ++"[@ c #CB0909", ++"}@ c #C60000", ++"|@ c #BD0000", ++"1@ c #A21408", ++"2@ c #B90000", ++"3@ c #C20000", ++"4@ c #D03333", ++"5@ c #F3CECE", ++"6@ c #E07B7B", ++"7@ c #E48888", ++"8@ c #CB0000", ++"9@ c #B70100", ++"0@ c #BB0000", ++"a@ c #C80000", ++"b@ c #C50000", ++"c@ c #CB2424", ++"d@ c #F5D7D7", ++"e@ c #D75C5C", ++"f@ c #ECB3B3", ++"g@ c #C40202", ++"h@ c #BA0000", ++"i@ c #991E0C", ++"j@ c #B10100", ++"k@ c #B50D05", ++"l@ c #B80C05", ++"m@ c #C30000", ++"n@ c #C40000", ++"o@ c #C61515", ++"p@ c #EAA8A8", ++"q@ c #EAAAAA", ++"r@ c #E7A0A0", ++"s@ c #C10202", ++"t@ c #A51E0C", ++"u@ c #903515", ++"v@ c #BA0602", ++"w@ c #B80000", ++"x@ c #AF0301", ++"y@ c #8C250F", ++"z@ c #AF0000", ++"A@ c #B30000", ++"B@ c #B40201", ++"C@ c #8A3414", ++"D@ c #B00E06", ++"E@ c #C51111", ++"F@ c #E38E8E", ++"G@ c #E69C9C", ++"H@ c #D35656", ++"I@ c #BE0202", ++"J@ c #BC0101", ++"K@ c #9D210D", ++"L@ c #912C11", ++"M@ c #AE0000", ++"N@ c #8A2810", ++"O@ c #A20301", ++"P@ c #A70000", ++"Q@ c #A80100", ++"R@ c #8E230E", ++"S@ c #AA0E06", ++"T@ c #E18686", ++"U@ c #CA2B2B", ++"V@ c #C51E1E", ++"W@ c #B70101", ++"X@ c #93250F", ++"Y@ c #941C0B", ++"Z@ c #A90000", ++"`@ c #990D05", ++" # c #7F2810", ++".# c #8F1307", ++"+# c #A40E06", ++"@# c #C41212", ++"## c #D96666", ++"$# c #BC0000", ++"%# c #B30101", ++"&# c #8F240E", ++"*# c #940C05", ++"=# c #9F0E06", ++"-# c #B00000", ++";# c #C01010", ++"># c #D76868", ++",# c #AF0101", ++"'# c #8B240E", ++")# c #990E06", ++"!# c #AA0000", ++"~# c #BE1818", ++"{# c #D26161", ++"]# c #AA0101", ++"^# c #87240E", ++"/# c #930E06", ++"(# c #A40000", ++"_# c #BC2424", ++":# c #C12F2F", ++"<# c #B10000", ++"[# c #A40101", ++"}# c #81250F", ++"|# c #8D0E05", ++"1# c #9D0000", ++"2# c #A30000", ++"3# c #AB0000", ++"4# c #A20000", ++"5# c #80220D", ++" ", ++" ", ++" ", ++" ", ++" ", ++" ", ++" ", ++" . + @ # # $ % & * ", ++" = - ; > , ' ) > ; ! ~ ", ++" { ] ^ / ( _ : < ^ [ } ", ++" | 1 < 2 3 4 5 6 7 8 9 ", ++" 0 < a b c d e f g h i ", ++" j k l m n d o p q r s t u v w ", ++" x y z A B C D E F G H I J K L M N O P ", ++" Q R S T U V W X Y Z c ` ...+.@.#.$. %.&.J T S *.=. ", ++" -.;.>.,.'.).!.~.{.].^./.(._.:.<.;.[.}.|.1.2.3.'.'.,.>.4.5. ", ++" 6.7.'.8.9.9.9.0.a.b.c.d.e.f.g.h.i.j.>.,.k.l.8.0.9.m.0.n.,.o.p. ", ++" q.r.>.n.s.t.u.t.v.w.x.9.8.d.y.z.A.B.C.>.d.n.9.x.v.t.u.v.s.n.>.D. ", ++" E.F.G.0.w.H.I.I.I.H.t.x.0.J.G.K.L.M.N.O.d.8.s.t.H.I.I.u.w.P.G.Q.R. ", ++" S.T.U.V.8.x.u.I.I.W.I.H.v.m.X.G.Y.q Z.`. +'.P.x.t.I.I.I.t.x.n.>..+++@+ ", ++" #+] 6 $+d.0.x.t.H.H.H.u.w.9.J.%+&+*+=+-+;+,.n.s.t.u.u.t.x.P.'.>+m ,+'+ ", ++" )+!+S ^.~+P.s.w.t.t.t.s.P.d.{+]+^+/+(+_+G.X.m.w.v.w.s.8.d.[..+1 :+ ", ++" <+U.^.~+8.m.x.w.x.0.X.G.[+p B.}+|+1+G.X.0.m.s.9.8.d.^.S 2+ ", ++" 3+4+V.~+8.9.m.9.n.d.^.5+6+ .7+8+9+V.J.P.0.0.8.~+>.0+ ", ++" a+,.~+n.P.n.~+V.>+S b+|+c+d+>+V.~+n.8.n.~+G.e+ ", ++" f+g+'.~+J.~+,.$+T h+i+j+k+S ;.V.'.J.X.J.,.l+m+ ", ++" n+o+p+[.G.'.'.,.^.q+r+s+t+u+v+.+q+^.,.~+~+'.G.[.w+x+y+ ", ++" z+A+B+k+T $+>.V.V.^.;.S C+D+E+F+G+6 T $+>.,.,.G.^.$+U.H+I+J+ ", ++" K+L+M+^ 6 T >+[.^.[.$+N+O+P+Q+R+N.S+7 S ;.[.>.>.>.[.>+U.6 1 T+U+V+ ", ++" W+X+Y+Z+`+g T q+>+$+;.N+S 2 @.@+@@@#@!+m U.q+>+$+$+;.q+T 6 !+Z+$@%@&@ ", ++" *@=@-@] `+g U.T N+N+T S 6 < ;@>@,@'@)@!@< m S T N+q+N+T U.6 `+Z+$@~@ ", ++" {@]@^@^ 7 g .+.+.+g m < ^ /@(@_@:@<@[@!@`+7 6 g .+.+.+g 7 1 }@|@1@ ", ++" 2@3@] ^ < < < `+`+!+1 #@Z+^@4@5@6@7@Z+8@!@^ `+`+< v+`+^ Z+-@9@ ", ++" 1@0@3@^@] 8@] ] Z+Z+Z+a@^@b@c@d@e@f@g@}@^@a@a@Z+] 8@] ^@3@h@i@ ", ++" j@2@]@Y+-@Y+Y+k@ l@m@n@m@o@p@q@r@s@-@t@u@v@Y+Y+-@Y+|@w@x@ ", ++" y@z@A@~@=@B@C@ D@$@Y+-@E@F@G@H@I@J@K@ L@=@=@~@A@M@N@ ", ++" O@P@Q@R@ S@h@]@Y+E@T@U@V@0@W@X@ Y@Z@P@`@ ", ++" #.# +#=@0@]@@###$@$#w@%#&# *# ", ++" =#-#=@h@;#>#$#2@~@,#'# ", ++" )#!#-#~@~#{#w@~@z@]#^# ", ++" /#(#!#M@_#:#<#M@Z@[#}# ", ++" |#1#2#P@!#3#!#P@4#1#5# ", ++" ", ++" ", ++" ", ++" ", ++" ", ++" "}; +diff --git a/unixODBC-2.3.7/tests/ODBCTestQ5.pro b/unixODBC-2.3.7/tests/ODBCTestQ5.pro +new file mode 100644 +index 0000000..9b29aa4 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/ODBCTestQ5.pro +@@ -0,0 +1,89 @@ ++include(../common.pri) ++include(../config.pri) ++include(../defines.pri) ++include(../odbc.pri) ++ ++#QT += widgets ++QT += gui ++ ++win32 { ++ LIBS += ..\lib\gtrtstQ5.lib ++ LIBS += user32.lib ++} ++ ++unix { ++ LIBS += -L../lib -lgtrtstQ5 ++} ++ ++TEMPLATE = app ++TARGET = ODBCTestQ5 ++VERSION = 1.0.1 ++DESTDIR = ../bin ++ ++# RC_FILE = ODBCTestQ5.rc ++# RESOURCES = ++ ++HEADERS = \ ++ attr.h \ ++ catalog.h \ ++ conn.h \ ++ desc.h \ ++ diag.h \ ++ DlgDbcConnect.h \ ++ DlgEnvAllocEnv.h \ ++ DlgEnvAllocHandle.h \ ++ DlgEnvDataSources.h \ ++ DlgEnvDrivers.h \ ++ DlgEnvEndTran.h \ ++ DlgEnvFreeEnv.h \ ++ DlgEnvFreeHandle.h \ ++ DlgEnvTransact.h \ ++ DlgToolsManageAutoTest.h \ ++ DlgToolsManageTest.h \ ++ DlgToolsManageTestGroup.h \ ++ DlgToolsNewGroup.h \ ++ DlgToolsNewSource.h \ ++ DlgToolsRunAutoTests.h \ ++ main.h \ ++ OdbcHandle.h \ ++ OdbcTest.h \ ++ results.h \ ++ stmt.h ++ ++ ++SOURCES = \ ++ attr.cpp \ ++ catalog.cpp \ ++ conn.cpp \ ++ desc.cpp \ ++ diag.cpp \ ++ DlgDbcConnect.cpp \ ++ DlgEnvAllocEnv.cpp \ ++ DlgEnvAllocHandle.cpp \ ++ DlgEnvDataSources.cpp \ ++ DlgEnvDrivers.cpp \ ++ DlgEnvEndTran.cpp \ ++ DlgEnvFreeEnv.cpp \ ++ DlgEnvFreeHandle.cpp \ ++ DlgEnvTransact.cpp \ ++ DlgToolsManageAutoTest.cpp \ ++ DlgToolsManageTest.cpp \ ++ DlgToolsManageTestGroup.cpp \ ++ DlgToolsNewGroup.cpp \ ++ DlgToolsNewSource.cpp \ ++ DlgToolsRunAutoTests.cpp \ ++ installer.cpp \ ++ main.cpp \ ++ OdbcHandle.cpp \ ++ OdbcTest.cpp \ ++ results.cpp \ ++ stmt.cpp ++ ++# ++# INSTALLS ++# ++!win32 { ++target.path = $$INSTALL_TARGET_BIN ++INSTALLS += target ++} ++ +diff --git a/unixODBC-2.3.7/tests/ODBCTestQ5.vpj b/unixODBC-2.3.7/tests/ODBCTestQ5.vpj +new file mode 100644 +index 0000000..023e552 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/ODBCTestQ5.vpj +@@ -0,0 +1,134 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/unixODBC-2.3.7/tests/ODBCTestQ5_resource.rc b/unixODBC-2.3.7/tests/ODBCTestQ5_resource.rc +new file mode 100644 +index 0000000..5f795f2 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/ODBCTestQ5_resource.rc +@@ -0,0 +1,39 @@ ++# if defined(UNDER_CE) ++# include ++# else ++# include ++# endif ++ ++VS_VERSION_INFO VERSIONINFO ++ FILEVERSION 1,0,1,0 ++ PRODUCTVERSION 1,0,1,0 ++ FILEFLAGSMASK 0x3fL ++#ifdef _DEBUG ++ FILEFLAGS VS_FF_DEBUG ++#else ++ FILEFLAGS 0x0L ++#endif ++ FILEOS VOS__WINDOWS32 ++ FILETYPE VFT_DLL ++ FILESUBTYPE 0x0L ++ BEGIN ++ BLOCK "StringFileInfo" ++ BEGIN ++ BLOCK "040904b0" ++ BEGIN ++ VALUE "CompanyName", "\0" ++ VALUE "FileDescription", "\0" ++ VALUE "FileVersion", "1.0.1.0\0" ++ VALUE "LegalCopyright", "\0" ++ VALUE "OriginalFilename", "ODBCTestQ5.exe\0" ++ VALUE "ProductName", "ODBCTestQ5\0" ++ VALUE "ProductVersion", "1.0.1.0\0" ++ END ++ END ++ BLOCK "VarFileInfo" ++ BEGIN ++ VALUE "Translation", 0x0409, 1200 ++ END ++ END ++/* End of Version info */ ++ +diff --git a/unixODBC-2.3.7/tests/OdbcHandle.cpp b/unixODBC-2.3.7/tests/OdbcHandle.cpp +new file mode 100644 +index 0000000..c4fb097 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/OdbcHandle.cpp +@@ -0,0 +1,224 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcHandle.h" ++ ++attr_value pEnvHandleTypes[] = ++{ ++ { "SQL_HANDLE_ENV", SQL_HANDLE_ENV, NULL, 0 }, ++ { "SQL_HANDLE_DBC", SQL_HANDLE_DBC, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++attr_value pEnvCompletionTypes[] = ++{ ++ { "SQL_COMMIT", SQL_COMMIT, NULL, 0 }, ++ { "SQL_ROLLBACK", SQL_ROLLBACK, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++attr_value pEnvDataSourcesDirections[] = ++{ ++ { "SQL_FETCH_NEXT", SQL_FETCH_NEXT, NULL, 0 }, ++ { "SQL_FETCH_FIRST", SQL_FETCH_FIRST, NULL, 0 }, ++ { "SQL_FETCH_FIRST_USER", SQL_FETCH_FIRST_USER, NULL, 0 }, ++ { "SQL_FETCH_FIRST_SYSTEM", SQL_FETCH_FIRST_SYSTEM, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++attr_value pEnvDriversDirections[] = ++{ ++ { "SQL_FETCH_NEXT", SQL_FETCH_NEXT, NULL, 0 }, ++ { "SQL_FETCH_FIRST", SQL_FETCH_FIRST, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++OdbcHandle::OdbcHandle( int t, SQLHANDLE h, QString desc, SQLHANDLE stmt ) ++{ ++ type = t; ++ handle = h; ++ ++ description = desc; ++ stmt_handle = stmt; ++ ++ if ( stmt ) ++ { ++ implicit = 1; ++ } ++ else ++ { ++ implicit = 0; ++ } ++ ++ handle_list = NULL; ++ ++ bookmark_ptr = new char[ 256 ]; ++ param_bind_offset_ptr = ¶m_bind_offset; ++ param_opt_ptr = ¶m_opt; ++ param_status_ptr = ¶m_status; ++ params_processed_ptr = ¶ms_processed; ++ row_bind_offset_ptr = &row_bind_offset; ++ row_operation_ptr = &row_operation; ++ row_status_ptr = &row_status; ++ rows_fetched_ptr = &rows_fetched; ++ ++ row_array_size = 0; ++ param_array_size = 0; ++} ++ ++OdbcHandle::OdbcHandle( int t, SQLHANDLE h, QList &list ) ++{ ++ type = t; ++ handle = h; ++ ++ implicit = 0; ++ description = ""; ++ stmt_handle = SQL_NULL_HANDLE; ++ handle_list = &list; ++ ++ bookmark_ptr = new char[ 256 ]; ++ param_bind_offset_ptr = ¶m_bind_offset; ++ param_opt_ptr = ¶m_opt; ++ param_status_ptr = ¶m_status; ++ params_processed_ptr = ¶ms_processed; ++ row_bind_offset_ptr = &row_bind_offset; ++ row_operation_ptr = &row_operation; ++ row_status_ptr = &row_status; ++ rows_fetched_ptr = &rows_fetched; ++ ++ row_array_size = 0; ++ param_array_size = 0; ++ ++ /* ++ * extract any desc handles associated with a statement handle ++ */ ++ ++ if ( type == SQL_HANDLE_STMT ) ++ { ++ SQLRETURN ret; ++ SQLHANDLE desc; ++ ++ ret = SQLGetStmtAttr( h, SQL_ATTR_APP_PARAM_DESC, &desc, 0, NULL ); ++ if ( SQL_SUCCEEDED( ret )) ++ list.append( new OdbcHandle( SQL_HANDLE_DESC, desc, "Implicit APD", h )); ++ ++ ret = SQLGetStmtAttr( h, SQL_ATTR_APP_ROW_DESC, &desc, 0, NULL ); ++ if ( SQL_SUCCEEDED( ret )) ++ list.append( new OdbcHandle( SQL_HANDLE_DESC, desc, "Implicit ARD", h )); ++ ++ ret = SQLGetStmtAttr( h, SQL_ATTR_IMP_PARAM_DESC, &desc, 0, NULL ); ++ if ( SQL_SUCCEEDED( ret )) ++ list.append( new OdbcHandle( SQL_HANDLE_DESC, desc, "Implicit IPD", h )); ++ ++ ret = SQLGetStmtAttr( h, SQL_ATTR_IMP_ROW_DESC, &desc, 0, NULL ); ++ if ( SQL_SUCCEEDED( ret )) ++ list.append( new OdbcHandle( SQL_HANDLE_DESC, desc, "Implicit IRD", h )); ++ } ++} ++ ++OdbcHandle::OdbcHandle( OdbcHandle &e ) ++{ ++ type = e.type; ++ handle = e.handle; ++ ++ implicit = 0; ++ description = ""; ++ stmt_handle = SQL_NULL_HANDLE; ++ ++ bookmark_ptr = new char[ 256 ]; ++ param_bind_offset_ptr = ¶m_bind_offset; ++ param_opt_ptr = ¶m_opt; ++ param_status_ptr = ¶m_status; ++ params_processed_ptr = ¶ms_processed; ++ row_bind_offset_ptr = &row_bind_offset; ++ row_operation_ptr = &row_operation; ++ row_status_ptr = &row_status; ++ rows_fetched_ptr = &rows_fetched; ++ ++ row_array_size = 0; ++ param_array_size = 0; ++}; ++ ++OdbcHandle::~OdbcHandle() ++{ ++ /* ++ * remove the implicit descriptors if a stmt is removed ++ */ ++ ++ if ( type == SQL_HANDLE_STMT ) ++ { ++ int changed = 0; ++ ++ do ++ { ++ changed = 0; ++ ++ { ++ for ( int i = 0; i < handle_list->size(); ++i ) ++ { ++ OdbcHandle *hand = handle_list->at( i ); ++ ++ if ( hand && hand->getType() == SQL_HANDLE_DESC && hand->getStmtHandle() == handle ) ++ { ++ handle_list->removeAll( hand ); ++ delete hand; ++ changed = 1; ++ break; ++ } ++ } ++ } ++ } ++ while( changed ); ++ } ++} ++ ++char * OdbcHandle::toStr( char * str ) ++{ ++ switch( type ) ++ { ++ case SQL_HANDLE_ENV: ++ sprintf( str, "henv: %p", handle ); ++ break; ++ ++ case SQL_HANDLE_DBC: ++ sprintf( str, "hdbc: %p", handle ); ++ break; ++ ++ case SQL_HANDLE_STMT: ++ sprintf( str, "hstmt: %p", handle ); ++ break; ++ ++ case SQL_HANDLE_DESC: ++ sprintf( str, "hdesc: %p \"%s\"", handle, description.toUtf8().constData() ); ++ break; ++ } ++ ++ return str; ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/OdbcHandle.h b/unixODBC-2.3.7/tests/OdbcHandle.h +new file mode 100644 +index 0000000..b64b754 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/OdbcHandle.h +@@ -0,0 +1,160 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++/* ++ * This is the first include file ODBCTestQ4 code needs to get in - ++ * directly or indirectly. This brings in the; standard C, ODBC, and Qt ++ * includes. ++ */ ++ ++/* bring in standard C stuff */ ++#include ++#ifdef UNIX ++ #include ++#endif ++#include ++ ++#if TIME_WITH_SYS_TIME ++# include ++# include ++#else ++# if HAVE_SYS_TIME_H ++# include ++# else ++# include ++# endif ++#endif ++ ++ ++/* this will bring in the ODBC 'test' stuff we need (and then some) */ ++#include ++ ++typedef BOOL (*AUTOTESTNAME)(LPSTR,UINT*); ++typedef BOOL (*AUTOTESTDESC)(UWORD,LPSTR,LPSTR); ++typedef void (*AUTOTESTFUNC)(SERVERINFO*); ++ ++/* bring in more ODBC stuff */ ++// #include ++#include ++ ++/* Qt */ ++#include ++ ++#ifdef Q_OS_WIN ++ #ifdef UNICODE ++ #define OtStringFromPlatform(x) QString::fromWCharArray(x) ++ #define OtStringToPlatform(x) (SQLTCHAR*)x.utf16() ++ #else ++ #define OtStringFromPlatform(x) QString(x) ++ #define OtStringToPlatform(x) (SQLTCHAR*)(x.toLocal8Bit().data()) ++ #endif ++#else ++ #ifdef UNICODE ++ #define TEXT(x) Lx ++ #define OtStringFromPlatform(x) QString::fromWCharArray(x) ++ #define OtStringToPlatform(x) (SQLTCHAR*)x.ucs4() ++ #else ++ #define TEXT(x) (SQLTCHAR*)x ++ #define OtStringFromPlatform(x) QString((const char*)x) ++ #define OtStringToPlatform(x) (SQLTCHAR*)(QString(x).toLocal8Bit().data()) ++ #endif ++#endif ++ ++/* ++ * structure that defines the options and values ++ */ ++ ++typedef struct attr_value ++{ ++ const char * text; ++ int value; ++ const char * version; ++ int data_type; ++} attr_value; ++ ++typedef struct attr_options ++{ ++ const char * text; ++ int attr; ++ attr_value values[ 25 ]; ++ const char * version; ++ int data_type; ++ int is_bitmap; ++ int is_pointer; ++} attr_options; ++ ++extern attr_value pEnvHandleTypes[]; ++extern attr_value pEnvCompletionTypes[]; ++extern attr_value pEnvDataSourcesDirections[]; ++extern attr_value pEnvDriversDirections[]; ++ ++/*! ++ * \brief ODBC handle. ++ * ++ * Our, not so, general purpose handle. This is a general purpose handle in that ++ * it supports all of the ODBC handle types. Its not so general purpose in the ++ * fact that we toss in some other stuff simply for convenience. ++ * ++ */ ++class OdbcHandle ++{ ++public: ++ OdbcHandle( int t, SQLHANDLE h, QList &list ); ++ OdbcHandle( int t, SQLHANDLE h, QString desc = QString::null, SQLHANDLE stmt = SQL_NULL_HANDLE ); ++ OdbcHandle( OdbcHandle &e ); ++ ~OdbcHandle(); ++ char * toStr( char * str ); ++ SQLHANDLE getHandle( void ) { return handle; }; ++ SQLHANDLE getStmtHandle( void ) { return stmt_handle; }; ++ int getType( void ) { return type; }; ++ char *bookmark_ptr; ++ ++ SQLUINTEGER row_array_size; ++ SQLUINTEGER param_array_size; ++ ++ SQLUINTEGER *param_bind_offset_ptr, param_bind_offset; ++ SQLUSMALLINT *param_opt_ptr, param_opt; ++ SQLUSMALLINT *param_status_ptr, param_status; ++ SQLUINTEGER *params_processed_ptr, params_processed; ++ SQLUINTEGER *row_bind_offset_ptr, row_bind_offset; ++ SQLUSMALLINT *row_operation_ptr, row_operation; ++ SQLUSMALLINT *row_status_ptr, row_status; ++ SQLUINTEGER *rows_fetched_ptr, rows_fetched; ++ ++private: ++ int type; // handle type ++ SQLHANDLE handle; // the underlying ODBC handle ++ QString description; // ++ int implicit; // for when we are a descriptor handle ++ SQLHANDLE stmt_handle; // for when we are a descriptor handle? ++ QList *handle_list; // subordinate/child handles ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/OdbcTest.cpp b/unixODBC-2.3.7/tests/OdbcTest.cpp +new file mode 100644 +index 0000000..f2ea003 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/OdbcTest.cpp +@@ -0,0 +1,1016 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcTest.h" ++#include "ODBCTestQ5-48.xpm" ++ ++#include "DlgEnvAllocHandle.h" ++#include "DlgEnvDataSources.h" ++#include "DlgEnvDrivers.h" ++#include "DlgEnvEndTran.h" ++#include "DlgEnvFreeHandle.h" ++#include "DlgEnvAllocEnv.h" ++#include "DlgEnvFreeEnv.h" ++#include "DlgEnvTransact.h" ++ ++OdbcTest::OdbcTest( QWidget *parent ) ++: QMainWindow( parent ) ++{ ++ setWindowTitle( "ODBC Test" ); ++ setWindowIcon( QPixmap( xpmODBCTestQ5_48 ) ); ++ ++ /*! ++ * Open the test configuration file once and allow all supporting code to use it. Let Qt ++ * delete the object when this (its parent) deconstructs. The settings will automatically ++ * sync to disk at that time. ++ * ++ * \note Using QSettings to read/write ini files imposes some limitations. The main ++ * one is that slashs in directory names need to be escaped. There may also be ++ * issues with the order in which things are read. ++ */ ++ pSettings = new QSettings( QDir::homePath() + "/Gator.ini", QSettings::IniFormat, this ); ++ ++ createActions(); ++ createMenus(); ++ ++ this->setGeometry( 0, 0, 500, 250 ); ++ ++ split = new QSplitter( Qt::Vertical, this ); ++ split->setOpaqueResize( FALSE ); ++ setCentralWidget( split ); ++ in_win = new QTextEdit( split ); ++ out_win = new QTextEdit( split ); ++ out_win->setReadOnly( TRUE ); ++ ++ readApplicationState(); ++} ++ ++OdbcTest::~OdbcTest() ++{ ++ writeApplicationState(); ++ ++ // delete all handles ++ while ( !listHandle.isEmpty() ) ++ delete listHandle.takeFirst(); ++} ++ ++void OdbcTest::slotExit() ++{ ++ qApp->quit(); ++} ++ ++const char * OdbcTest::return_as_text( int ret ) ++{ ++ switch ( ret ) ++ { ++ case SQL_SUCCESS: ++ return "SQL_SUCCESS"; ++ ++ case SQL_SUCCESS_WITH_INFO: ++ return "SQL_SUCCESS_WITH_INFO"; ++ ++ case SQL_ERROR: ++ return "SQL_ERROR"; ++ ++ case SQL_INVALID_HANDLE: ++ return "SQL_INVALID_HANDLE"; ++ ++ case SQL_STILL_EXECUTING: ++ return "SQL_STILL_EXECUTING"; ++ ++ case SQL_NEED_DATA: ++ return "SQL_NEED_DATA"; ++ ++ case SQL_NO_DATA: ++ return "SQL_NO_DATA"; ++ ++ default: ++ return "Unknown Return ?"; ++ } ++} ++ ++void OdbcTest::fill_list_box( attr_value *attr, QComboBox *lst ) ++{ ++ char txt[ 128 ]; ++ ++ for ( int i = 0; attr[ i ].text; i ++ ) ++ { ++ if ( strlen( attr[ i ].text ) > 0 ) ++ { ++ if ( attr[ i ].version ) ++ { ++ sprintf( txt, "%s=%d (%s)", attr[ i ].text, ++ attr[ i ].value, attr[ i ].version ); ++ } ++ else ++ { ++ sprintf( txt, "%s=%d", attr[ i ].text, ++ attr[ i ].value ); ++ } ++ } ++ else ++ { ++ sprintf( txt, "%d", attr[ i ].value ); ++ } ++ lst->insertItem( i, txt ); ++ } ++} ++ ++void OdbcTest::fill_list_box( attr_options *attr, QComboBox *lst ) ++{ ++ char txt[ 128 ]; ++ ++ for ( int i = 0; attr[ i ].text; i ++ ) ++ { ++ if ( strlen( attr[ i ].text ) > 0 ) ++ { ++ if ( attr[ i ].version ) ++ { ++ sprintf( txt, "%s=%d (%s)", attr[ i ].text, ++ attr[ i ].attr, attr[ i ].version ); ++ } ++ else ++ { ++ sprintf( txt, "%s=%d", attr[ i ].text, ++ attr[ i ].attr ); ++ } ++ } ++ else ++ { ++ sprintf( txt, "%d", attr[ i ].attr ); ++ } ++ lst->insertItem( i, txt ); ++ } ++} ++ ++SQLHANDLE OdbcTest::get_handle( int type ) ++{ ++ QListIterator it( listHandle ); ++ ++ while ( it.hasNext() ) ++ { ++ OdbcHandle *hand = it.next(); ++ if ( hand && hand->getType() == type ) ++ { ++ return hand->getHandle(); ++ } ++ } ++ ++ return SQL_NULL_HANDLE; ++} ++ ++OdbcHandle * OdbcTest::fill_handle_list( int type, QComboBox *lst ) ++{ ++ QListIterator it( listHandle ); ++ OdbcHandle * match = NULL; ++ int i = 0; ++ char txt[128]; ++ ++ while ( it.hasNext() ) ++ { ++ OdbcHandle *hand = it.next(); ++ if ( !hand ) ++ break; ++ ++ hand->toStr( txt ); ++ if ( type < 0 ) ++ { ++ lst->insertItem( i++, txt ); ++ match = hand; ++ } ++ else if ( hand->getType() == type ) ++ { ++ lst->insertItem( i++, txt ); ++ match = hand; ++ } ++ } ++ ++ lst->insertItem( i, "SQL_NULL_HANDLE" ); ++ ++ return match; ++} ++ ++OdbcHandle *OdbcTest::extract_handle_list( int type, QComboBox *lst ) ++{ ++ QListIterator it( listHandle ); ++ int index = lst->currentIndex(); ++ int i = 0; ++ OdbcHandle * hand = NULL; ++ ++ while ( it.hasNext() ) ++ { ++ hand = it.next(); ++ if ( !hand ) ++ break; ++ if ( type < 0 || hand->getType() == type ) ++ { ++ if ( i == index ) ++ { ++ break; ++ } ++ i++; ++ } ++ } ++ ++ return hand; ++} ++ ++void OdbcTest::fill_dsn_list( QComboBox *box ) ++{ ++ SQLHANDLE henv; ++ SQLRETURN ret; ++ SQLCHAR dsn_txt[ 128 ]; ++ ++ box -> clear(); ++ ++ ret = SQLAllocEnv( &henv ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ out_win -> append( "SQLAllocHandle fails allocating a environment handle" ); ++ return; ++ } ++ ++ ret = SQLDataSources( henv, ++ SQL_FETCH_FIRST, ++ dsn_txt, ++ sizeof( dsn_txt ), ++ NULL, ++ NULL, ++ 0, ++ NULL ); ++ ++ while ( SQL_SUCCEEDED( ret )) ++ { ++ box -> addItem( (char*)dsn_txt ); ++ ret = SQLDataSources( henv, ++ SQL_FETCH_NEXT, ++ dsn_txt, ++ sizeof( dsn_txt ), ++ NULL, ++ NULL, ++ 0, ++ NULL ); ++ } ++ ++ SQLFreeEnv( henv ); ++} ++ ++void OdbcTest::set_dsn_list( QComboBox *box, const QString &stringItem ) ++{ ++ int index; ++ ++ for ( index = 0; index < box->count(); index ++ ) ++ { ++ if ( box->itemText( index ) == stringItem ) ++ { ++ box->setCurrentIndex( index ); ++ break; ++ } ++ } ++} ++ ++void OdbcTest::dumpError( int type, SQLHANDLE hnd ) ++{ ++ SQLRETURN ret; ++ SQLINTEGER count, i; ++ char handle[ 30 ]; ++ ++ switch ( type ) ++ { ++ case SQL_HANDLE_ENV: ++ sprintf( handle, "henv %p", hnd ); ++ break; ++ ++ case SQL_HANDLE_DBC: ++ sprintf( handle, "hdbc %p", hnd ); ++ break; ++ ++ case SQL_HANDLE_STMT: ++ sprintf( handle, "hstmt %p", hnd ); ++ break; ++ ++ case SQL_HANDLE_DESC: ++ sprintf( handle, "hdesc %p", hnd ); ++ break; ++ ++ default: ++ strcpy( handle, "unknown handle" ); ++ break; ++ } ++ ++ ret = SQLGetDiagField( type, hnd, 0, SQL_DIAG_NUMBER, ++ &count, 0, NULL ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ out_win->append( "SQLGetDiagField( SQL_DIAG_NUMBER ) failed" ); ++ return; ++ } ++ ++ for ( i = 1; i <= count; i ++ ) ++ { ++ SQLCHAR sqlstate[ 6 ]; ++ SQLINTEGER native; ++ SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH ]; ++ char txt[ SQL_MAX_MESSAGE_LENGTH + 50 ]; ++ ++ ret = SQLGetDiagRec( type, hnd, i, sqlstate, ++ &native, message_text, sizeof( message_text ), ++ NULL ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ out_win->append( "SQLGetDiagRec() failed" ); ++ return; ++ } ++ ++ sprintf( txt, "Diag(%s):%s:%d:%s", ++ handle, sqlstate, native, message_text ); ++ ++ out_win->append( txt ); ++ } ++} ++ ++void OdbcTest::slotHelpApi() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotHelpTest() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotHelpAbout() ++{ ++ /*! ++ * \todo ++ * ++ * 1. create unixODBC.adp ++ * 2. get unixODBC.adp and associated doc to install in various install scenarios ++ * 3. tweek the way we get the path to the doc so its more portable (currently just Linux friendly) ++ * ++ * \sa ++ * ++ * slotHelp ++ */ ++ QProcess *process = new QProcess( this ); ++ QString app = QLibraryInfo::location( QLibraryInfo::BinariesPath ) + QLatin1String( "/assistant" ); ++ ++ process->start( app, QStringList() << QLatin1String( "-enableRemoteControl" ) ); ++ if ( !process->waitForStarted() ) ++ { ++ QMessageBox::critical(this, tr("ODBC Test"), tr("Could not start Qt Assistant from %1.").arg( app ) ); ++ return; ++ } ++ ++ // show index page ++ // "SetSource qthelp://unixODBC-GUI-Qt/doc/index.html" ++ QTextStream str( process ); ++ str << QLatin1String( "SetSource qthelp://org.unixODBC.doc/doc/ODBCTestQ4/index.html" ) ++ << QLatin1Char('\0') << endl; ++} ++ ++void OdbcTest::resizeEvent( QResizeEvent * ) ++{ ++ // label->setGeometry( 20, rect().center().y()-20, width()-40, 40 ); ++} ++ ++const char *OdbcTest::int_type_as_string( SQLINTERVAL itype ) ++{ ++ switch ( itype ) ++ { ++ case SQL_IS_YEAR: ++ return "SQL_IS_YEAR"; ++ ++ case SQL_IS_MONTH: ++ return "SQL_IS_MONTH"; ++ ++ case SQL_IS_DAY: ++ return "SQL_IS_DAY"; ++ ++ case SQL_IS_HOUR: ++ return "SQL_IS_HOUR"; ++ ++ case SQL_IS_MINUTE: ++ return "SQL_IS_MINUTE"; ++ ++ case SQL_IS_SECOND: ++ return "SQL_IS_SECOND"; ++ ++ case SQL_IS_YEAR_TO_MONTH: ++ return "SQL_IS_YEAR_TO_MONTH"; ++ ++ case SQL_IS_DAY_TO_HOUR : ++ return "SQL_IS_DAY_TO_HOUR"; ++ ++ case SQL_IS_DAY_TO_MINUTE: ++ return "SQL_IS_DAY_TO_MINUTE"; ++ ++ case SQL_IS_DAY_TO_SECOND: ++ return "SQL_IS_DAY_TO_SECOND"; ++ ++ case SQL_IS_HOUR_TO_MINUTE: ++ return "SQL_IS_HOUR_TO_MINUTE"; ++ ++ case SQL_IS_HOUR_TO_SECOND: ++ return "SQL_IS_HOUR_TO_SECOND"; ++ ++ case SQL_IS_MINUTE_TO_SECOND: ++ return "SQL_IS_MINUTE_TO_SECOND"; ++ } ++ ++ return "Unknown Type"; ++} ++ ++void OdbcTest::createActions() ++{ ++ pactionExit = new QAction( tr("E&xit"), this ); ++ pactionGetDiagRec = new QAction( tr("SQLGetDiag&Rec..."), this ); ++ pactionGetDiagField = new QAction( tr("SQLGetDiag&Field..."), this ); ++ pactionError = new QAction( tr("SQL&Error..."), this ); ++ pactionErrorsAll = new QAction( tr("Errors &All..."), this ); ++ pactionAllocEnv = new QAction( tr("SQL&AllocEnv..."), this ); ++ pactionAllocHandle = new QAction( tr("SQL&AllocHandle..."), this ); ++ pactionDataSources = new QAction( tr("SQLDataS&ources..."), this ); ++ pactionDrivers = new QAction( tr("S&QLDrivers..."), this ); ++ pactionFreeEnv = new QAction( tr("SQL&FreeEnv..."), this ); ++ pactionFreeHandle = new QAction( tr("SQLF&reeHandle..."), this ); ++ pactionEndTran = new QAction( tr("SQLE&ndTran..."), this ); ++ pactionTransact = new QAction( tr("SQL&Transact..."), this ); ++ pactionDataSourcesAll = new QAction( tr("Data &Sources All..."), this ); ++ pactionDriversAll = new QAction( tr("Dri&vers All..."), this ); ++ pactionAllocConnect = new QAction( tr("SQL&AllocConnect..."), this ); ++ pactionBrowseConnect = new QAction( tr("SQL&BrowseConnect..."), this ); ++ pactionConnect = new QAction( tr("SQL&Connect..."), this ); ++ pactionDriverConnect = new QAction( tr("SQLD&riverConnect..."), this ); ++ pactionDisconnect = new QAction( tr("SQL&Disconnect..."), this ); ++ pactionFreeConnect = new QAction( tr("SQL&FreeConnect..."), this ); ++ pactionGetFunctions = new QAction( tr("S&QLGetFunctions..."), this ); ++ pactionGetInfo = new QAction( tr("SQLGet&Info..."), this ); ++ pactionNativeSql = new QAction( tr("SQLN&ativeSQL..."), this ); ++ pactionFullConnect = new QAction( tr("F&ull Connect..."), this ); ++ pactionFullDisconnect = new QAction( tr("Fu&ll Disconnect..."), this ); ++ pactionGetInfoAll = new QAction( tr("G&et Info All..."), this ); ++ pactionGetFunctionsAll = new QAction( tr("Get &Functions All..."), this ); ++ pactionCopyDesc = new QAction( tr("SQLCop&yDesc..."), this ); ++ pactionGetDescField = new QAction( tr("SQLGetDesc&Field..."), this ); ++ pactionGetDescRec = new QAction( tr("SQLG&etDescRec..."), this ); ++ pactionSetDescField = new QAction( tr("SQLSetDescF&ield..."), this ); ++ pactionSetDescRec = new QAction( tr("SQLSetDescRec..."), this ); ++ pactionGetDescAll = new QAction( tr("Get Desc All..."), this ); ++ pactionAllocStmt = new QAction( tr("SQLAllocStmt..."), this ); ++ pactionBindParam = new QAction( tr("SQLBindParam,..."), this ); ++ pactionBindParameter = new QAction( tr("SQLBindParameter..."), this ); ++ pactionCancel = new QAction( tr("SQLCancel..."), this ); ++ pactionCloseCursor = new QAction( tr("SQLCloseCursor..."), this ); ++ pactionDescribeParam = new QAction( tr("SQLDescribeParam..."), this ); ++ pactionExecute = new QAction( tr("SQLExecute..."), this ); ++ pactionExecDirect = new QAction( tr("SQLExecDirect..."), this ); ++ pactionFreeStmt = new QAction( tr("SQLFreeStmt..."), this ); ++ pactionGetCursorName = new QAction( tr("SQLGetCursorName..."), this ); ++ pactionNumParams = new QAction( tr("SQLNumParams..."), this ); ++ pactionParamData = new QAction( tr("SQLParamData..."), this ); ++ pactionParamOptions = new QAction( tr("SQLParamOptions..."), this ); ++ pactionPrepare = new QAction( tr("SQLPrepare..."), this ); ++ pactionPutData = new QAction( tr("SQLPutData..."), this ); ++ pactionSetCursorName = new QAction( tr("SQLSetCursorName..."), this ); ++ pactionFillParam = new QAction( tr("Fill Param..."), this ); ++ pactionShowParam = new QAction( tr("Show Param..."), this ); ++ pactionShowCursorSettings = new QAction( tr("Show Cursor Settings..."), this ); ++ pactionSetStmtAttr = new QAction( tr("SQLSetStmtAttr..."), this ); ++ pactionGetStmtAttr = new QAction( tr("SQLGetStmtAttr..."), this ); ++ pactionSetStmtOption = new QAction( tr("SQLSetStmtOption..."), this ); ++ pactionGetStmtOption = new QAction( tr("SQLGetStmtOption..."), this ); ++ pactionSetConnectAttr = new QAction( tr("SQLSetConnectAttr..."), this ); ++ pactionGetConnectAttr = new QAction( tr("SQLGetConnectAttr..."), this ); ++ pactionSetConnectOption = new QAction( tr("SQLSetConnectOption..."), this ); ++ pactionGetConnectOption = new QAction( tr("SQLGetConnectOption..."), this ); ++ pactionSetEnvAttr = new QAction( tr("SQLSetEnvAttr..."), this ); ++ pactionGetEnvAttr = new QAction( tr("SQLGetEnvAttr..."), this ); ++ pactionSetCursorAttributes = new QAction( tr("Set Cursor Attributes..."), this ); ++ pactionBindCol = new QAction( tr("SQLBindCol..."), this ); ++ pactionBulkOperations = new QAction( tr("SQLBulkOperations..."), this ); ++ pactionColAttributes = new QAction( tr("SQLColAttributes..."), this ); ++ pactionColAttribute = new QAction( tr("SQLColAttribute..."), this ); ++ pactionDescribeCol = new QAction( tr("SQLDescribeCol..."), this ); ++ pactionExtendedFetch = new QAction( tr("SQLExtendedFetch..."), this ); ++ pactionFetch = new QAction( tr("SQLFetch..."), this ); ++ pactionFetchScroll = new QAction( tr("SQLFetchScroll..."), this ); ++ pactionGetData = new QAction( tr("SQLGetData..."), this ); ++ pactionMoreResults = new QAction( tr("SQLMoreResults..."), this ); ++ pactionNumResultCols = new QAction( tr("SQLNumResultCols..."), this ); ++ pactionRowCount = new QAction( tr("SQLRowCount..."), this ); ++ pactionSetPos = new QAction( tr("SQLSetPos..."), this ); ++ pactionSetScrollOptions = new QAction( tr("SQLSetScrollOptions..."), this ); ++ pactionBindColAll = new QAction( tr("Bind Col All..."), this ); ++ pactionDescribeColAll = new QAction( tr("Describe Col All..."), this ); ++ pactionFetchAll = new QAction( tr("Fetch All..."), this ); ++ pactionGetDataAll = new QAction( tr("Get Data All..."), this ); ++ pactionShowBoundCols = new QAction( tr("Show Bound Cols..."), this ); ++ pactionDisplayRowSet = new QAction( tr("Display Row Set..."), this ); ++ pactionColumns = new QAction( tr("SQLColumns..."), this ); ++ pactionColumnPrivileges = new QAction( tr("SQLColumnPrivileges..."), this ); ++ pactionGetTypeInfo = new QAction( tr("SQLGetTypeInfo..."), this ); ++ pactionForeignKeys = new QAction( tr("SQLForeignKeys..."), this ); ++ pactionPrimaryKeys = new QAction( tr("SQLPrimaryKeys..."), this ); ++ pactionProcedures = new QAction( tr("SQLProcedures..."), this ); ++ pactionProcedureColumns = new QAction( tr("SQLProcedureColumns..."), this ); ++ pactionSpecialColumns = new QAction( tr("SQLSpecialColumns..."), this ); ++ pactionStatistics = new QAction( tr("SQLStatistics..."), this ); ++ pactionTables = new QAction( tr("SQLTables..."), this ); ++ pactionTablePrivileges = new QAction( tr("SQLTablePrivileges..."), this ); ++ pactionManageDataSources = new QAction( tr("SQLManageDataSources..."), this ); ++ pactionRemoveDefaultDataSource = new QAction( tr("SQLRemoveDefaultDataSource..."), this ); ++ pactionConfigDataSource = new QAction( tr("SQLConfigDataSource..."), this ); ++ pactionCreateDataSource = new QAction( tr("SQLCreateDataSource..."), this ); ++ pactionValidDSN = new QAction( tr("SQLValidDSN..."), this ); ++ pactionRemoveDSNFromIni = new QAction( tr("SQLRemoveDSNFromIni..."), this ); ++ pactionWriteDSNToIni = new QAction( tr("SQLWriteDSNToIni..."), this ); ++ pactionRemoveDrivers = new QAction( tr("SQLRemoveDrivers..."), this ); ++ pactionConfigDrivers = new QAction( tr("SQLConfigDrivers..."), this ); ++ pactionInstallDriver = new QAction( tr("SQLInstallDriver..."), this ); ++ pactionInstallDriverEx = new QAction( tr("SQLInstallDriverEx..."), this ); ++ pactionGetInstalledDrivers = new QAction( tr("SQLGetInstalledDrivers..."), this ); ++ pactionRemoveDriverManager = new QAction( tr("SQLRemoveDriverManager..."), this ); ++ pactionInstallDriverManager = new QAction( tr("SQLInstallDriverManager..."), this ); ++ pactionReadFileDSN = new QAction( tr("SQLReadFileDSN..."), this ); ++ pactionWriteFileDSN = new QAction( tr("SQLWriteFileDSN..."), this ); ++ pactionWritePrivateProfileString = new QAction( tr("SQLWritePrivateProfileString..."), this ); ++ pactionGetPrivateProfileString = new QAction( tr("SQLGetPrivateProfileString..."), this ); ++ pactionInstallTranslator = new QAction( tr("SQLInstallTranslator..."), this ); ++ pactionInstallTranslatorEx = new QAction( tr("SQLInstallTranslatorEx..."), this ); ++ pactionRemoveTranslator = new QAction( tr("SQLRemoveTranslator..."), this ); ++ pactionGetTranslator = new QAction( tr("SQLGetTranslator..."), this ); ++ pactionSetConfigMode = new QAction( tr("SQLSetConfigMode..."), this ); ++ pactionGetConfigMode = new QAction( tr("SQLGetConfigMode..."), this ); ++ pactionOptions = new QAction( tr("Options..."), this ); ++ pactionTrace = new QAction( tr("Trace..."), this ); ++ pactionManageTestSources = new QAction( tr("Manage Test Sources..."), this ); ++ pactionManageAutoTests = new QAction( tr("Manage Auto Tests..."), this ); ++ pactionManageTestGroups = new QAction( tr("Manage Test Groups..."), this ); ++ pactionRunAutoTests = new QAction( tr("Run Auto Tests..."), this ); ++ pactionHelpTest = new QAction( tr("&ODBC Test..."), this ); ++ pactionHelpApi = new QAction( tr("A&PI..."), this ); ++ pactionHelpAbout = new QAction( tr("About..."), this ); ++ ++ connect( pactionExit , SIGNAL(triggered()), this, SLOT(slotExit ()) ); ++ connect( pactionGetDiagRec , SIGNAL(triggered()), this, SLOT(slotGetDiagRec ()) ); ++ connect( pactionGetDiagField , SIGNAL(triggered()), this, SLOT(slotGetDiagField ()) ); ++ connect( pactionError , SIGNAL(triggered()), this, SLOT(slotError ()) ); ++ connect( pactionErrorsAll , SIGNAL(triggered()), this, SLOT(slotErrorsAll ()) ); ++ connect( pactionAllocEnv , SIGNAL(triggered()), this, SLOT(slotAllocEnv ()) ); ++ connect( pactionAllocHandle , SIGNAL(triggered()), this, SLOT(slotAllocHandle ()) ); ++ connect( pactionDataSources , SIGNAL(triggered()), this, SLOT(slotDataSources ()) ); ++ connect( pactionDrivers , SIGNAL(triggered()), this, SLOT(slotDrivers ()) ); ++ connect( pactionFreeEnv , SIGNAL(triggered()), this, SLOT(slotFreeEnv ()) ); ++ connect( pactionFreeHandle , SIGNAL(triggered()), this, SLOT(slotFreeHandle ()) ); ++ connect( pactionEndTran , SIGNAL(triggered()), this, SLOT(slotEndTran ()) ); ++ connect( pactionTransact , SIGNAL(triggered()), this, SLOT(slotTransact ()) ); ++ connect( pactionDataSourcesAll , SIGNAL(triggered()), this, SLOT(slotDataSourcesAll ()) ); ++ connect( pactionDriversAll , SIGNAL(triggered()), this, SLOT(slotDriversAll ()) ); ++ connect( pactionAllocConnect , SIGNAL(triggered()), this, SLOT(slotAllocConnect ()) ); ++ connect( pactionBrowseConnect , SIGNAL(triggered()), this, SLOT(slotBrowseConnect ()) ); ++ connect( pactionConnect , SIGNAL(triggered()), this, SLOT(slotConnect ()) ); ++ connect( pactionDriverConnect , SIGNAL(triggered()), this, SLOT(slotDriverConnect ()) ); ++ connect( pactionDisconnect , SIGNAL(triggered()), this, SLOT(slotDisconnect ()) ); ++ connect( pactionFreeConnect , SIGNAL(triggered()), this, SLOT(slotFreeConnect ()) ); ++ connect( pactionGetFunctions , SIGNAL(triggered()), this, SLOT(slotGetFunctions ()) ); ++ connect( pactionGetInfo , SIGNAL(triggered()), this, SLOT(slotGetInfo ()) ); ++ connect( pactionNativeSql , SIGNAL(triggered()), this, SLOT(slotNativeSql ()) ); ++ connect( pactionFullConnect , SIGNAL(triggered()), this, SLOT(slotFullConnect ()) ); ++ connect( pactionFullDisconnect , SIGNAL(triggered()), this, SLOT(slotFullDisconnect ()) ); ++ connect( pactionGetInfoAll , SIGNAL(triggered()), this, SLOT(slotGetInfoAll ()) ); ++ connect( pactionGetFunctionsAll , SIGNAL(triggered()), this, SLOT(slotGetFunctionsAll ()) ); ++ connect( pactionCopyDesc , SIGNAL(triggered()), this, SLOT(slotCopyDesc ()) ); ++ connect( pactionGetDescField , SIGNAL(triggered()), this, SLOT(slotGetDescField ()) ); ++ connect( pactionGetDescRec , SIGNAL(triggered()), this, SLOT(slotGetDescRec ()) ); ++ connect( pactionSetDescField , SIGNAL(triggered()), this, SLOT(slotSetDescField ()) ); ++ connect( pactionSetDescRec , SIGNAL(triggered()), this, SLOT(slotSetDescRec ()) ); ++ connect( pactionGetDescAll , SIGNAL(triggered()), this, SLOT(slotGetDescAll ()) ); ++ connect( pactionAllocStmt , SIGNAL(triggered()), this, SLOT(slotAllocStmt ()) ); ++ connect( pactionBindParam , SIGNAL(triggered()), this, SLOT(slotBindParam ()) ); ++ connect( pactionBindParameter , SIGNAL(triggered()), this, SLOT(slotBindParameter ()) ); ++ connect( pactionCancel , SIGNAL(triggered()), this, SLOT(slotCancel ()) ); ++ connect( pactionCloseCursor , SIGNAL(triggered()), this, SLOT(slotCloseCursor ()) ); ++ connect( pactionDescribeParam , SIGNAL(triggered()), this, SLOT(slotDescribeParam ()) ); ++ connect( pactionExecute , SIGNAL(triggered()), this, SLOT(slotExecute ()) ); ++ connect( pactionExecDirect , SIGNAL(triggered()), this, SLOT(slotExecDirect ()) ); ++ connect( pactionFreeStmt , SIGNAL(triggered()), this, SLOT(slotFreeStmt ()) ); ++ connect( pactionGetCursorName , SIGNAL(triggered()), this, SLOT(slotGetCursorName ()) ); ++ connect( pactionNumParams , SIGNAL(triggered()), this, SLOT(slotNumParams ()) ); ++ connect( pactionParamData , SIGNAL(triggered()), this, SLOT(slotParamData ()) ); ++ connect( pactionParamOptions , SIGNAL(triggered()), this, SLOT(slotParamOptions ()) ); ++ connect( pactionPrepare , SIGNAL(triggered()), this, SLOT(slotPrepare ()) ); ++ connect( pactionPutData , SIGNAL(triggered()), this, SLOT(slotPutData ()) ); ++ connect( pactionSetCursorName , SIGNAL(triggered()), this, SLOT(slotSetCursorName ()) ); ++ connect( pactionFillParam , SIGNAL(triggered()), this, SLOT(slotFillParam ()) ); ++ connect( pactionShowParam , SIGNAL(triggered()), this, SLOT(slotShowParam ()) ); ++ connect( pactionShowCursorSettings , SIGNAL(triggered()), this, SLOT(slotShowCursorSettings ()) ); ++ connect( pactionSetStmtAttr , SIGNAL(triggered()), this, SLOT(slotSetStmtAttr ()) ); ++ connect( pactionGetStmtAttr , SIGNAL(triggered()), this, SLOT(slotGetStmtAttr ()) ); ++ connect( pactionSetStmtOption , SIGNAL(triggered()), this, SLOT(slotSetStmtOption ()) ); ++ connect( pactionGetStmtOption , SIGNAL(triggered()), this, SLOT(slotGetStmtOption ()) ); ++ connect( pactionSetConnectAttr , SIGNAL(triggered()), this, SLOT(slotSetConnectAttr ()) ); ++ connect( pactionGetConnectAttr , SIGNAL(triggered()), this, SLOT(slotGetConnectAttr ()) ); ++ connect( pactionSetConnectOption , SIGNAL(triggered()), this, SLOT(slotSetConnectOption ()) ); ++ connect( pactionGetConnectOption , SIGNAL(triggered()), this, SLOT(slotGetConnectOption ()) ); ++ connect( pactionSetEnvAttr , SIGNAL(triggered()), this, SLOT(slotSetEnvAttr ()) ); ++ connect( pactionGetEnvAttr , SIGNAL(triggered()), this, SLOT(slotGetEnvAttr ()) ); ++ connect( pactionSetCursorAttributes , SIGNAL(triggered()), this, SLOT(slotSetCursorAttributes ()) ); ++ connect( pactionBindCol , SIGNAL(triggered()), this, SLOT(slotBindCol ()) ); ++ connect( pactionBulkOperations , SIGNAL(triggered()), this, SLOT(slotBulkOperations ()) ); ++ connect( pactionColAttributes , SIGNAL(triggered()), this, SLOT(slotColAttributes ()) ); ++ connect( pactionColAttribute , SIGNAL(triggered()), this, SLOT(slotColAttribute ()) ); ++ connect( pactionDescribeCol , SIGNAL(triggered()), this, SLOT(slotDescribeCol ()) ); ++ connect( pactionExtendedFetch , SIGNAL(triggered()), this, SLOT(slotExtendedFetch ()) ); ++ connect( pactionFetch , SIGNAL(triggered()), this, SLOT(slotFetch ()) ); ++ connect( pactionFetchScroll , SIGNAL(triggered()), this, SLOT(slotFetchScroll ()) ); ++ connect( pactionGetData , SIGNAL(triggered()), this, SLOT(slotGetData ()) ); ++ connect( pactionMoreResults , SIGNAL(triggered()), this, SLOT(slotMoreResults ()) ); ++ connect( pactionNumResultCols , SIGNAL(triggered()), this, SLOT(slotNumResultCols ()) ); ++ connect( pactionRowCount , SIGNAL(triggered()), this, SLOT(slotRowCount ()) ); ++ connect( pactionSetPos , SIGNAL(triggered()), this, SLOT(slotSetPos ()) ); ++ connect( pactionSetScrollOptions , SIGNAL(triggered()), this, SLOT(slotSetScrollOptions ()) ); ++ connect( pactionBindColAll , SIGNAL(triggered()), this, SLOT(slotBindColAll ()) ); ++ connect( pactionDescribeColAll , SIGNAL(triggered()), this, SLOT(slotDescribeColAll ()) ); ++ connect( pactionFetchAll , SIGNAL(triggered()), this, SLOT(slotFetchAll ()) ); ++ connect( pactionGetDataAll , SIGNAL(triggered()), this, SLOT(slotGetDataAll ()) ); ++ connect( pactionShowBoundCols , SIGNAL(triggered()), this, SLOT(slotShowBoundCols ()) ); ++ connect( pactionDisplayRowSet , SIGNAL(triggered()), this, SLOT(slotDisplayRowSet ()) ); ++ connect( pactionColumns , SIGNAL(triggered()), this, SLOT(slotColumns ()) ); ++ connect( pactionColumnPrivileges , SIGNAL(triggered()), this, SLOT(slotColumnPrivileges ()) ); ++ connect( pactionGetTypeInfo , SIGNAL(triggered()), this, SLOT(slotGetTypeInfo ()) ); ++ connect( pactionForeignKeys , SIGNAL(triggered()), this, SLOT(slotForeignKeys ()) ); ++ connect( pactionPrimaryKeys , SIGNAL(triggered()), this, SLOT(slotPrimaryKeys ()) ); ++ connect( pactionProcedures , SIGNAL(triggered()), this, SLOT(slotProcedures ()) ); ++ connect( pactionProcedureColumns , SIGNAL(triggered()), this, SLOT(slotProcedureColumns ()) ); ++ connect( pactionSpecialColumns , SIGNAL(triggered()), this, SLOT(slotSpecialColumns ()) ); ++ connect( pactionStatistics , SIGNAL(triggered()), this, SLOT(slotStatistics ()) ); ++ connect( pactionTables , SIGNAL(triggered()), this, SLOT(slotTables ()) ); ++ connect( pactionTablePrivileges , SIGNAL(triggered()), this, SLOT(slotTablePrivileges ()) ); ++ connect( pactionManageDataSources , SIGNAL(triggered()), this, SLOT(slotManageDataSources ()) ); ++ connect( pactionRemoveDefaultDataSource , SIGNAL(triggered()), this, SLOT(slotRemoveDefaultDataSource ()) ); ++ connect( pactionConfigDataSource , SIGNAL(triggered()), this, SLOT(slotConfigDataSource ()) ); ++ connect( pactionCreateDataSource , SIGNAL(triggered()), this, SLOT(slotCreateDataSource ()) ); ++ connect( pactionValidDSN , SIGNAL(triggered()), this, SLOT(slotValidDSN ()) ); ++ connect( pactionRemoveDSNFromIni , SIGNAL(triggered()), this, SLOT(slotRemoveDSNFromIni ()) ); ++ connect( pactionWriteDSNToIni , SIGNAL(triggered()), this, SLOT(slotWriteDSNToIni ()) ); ++ connect( pactionRemoveDrivers , SIGNAL(triggered()), this, SLOT(slotRemoveDrivers ()) ); ++ connect( pactionConfigDrivers , SIGNAL(triggered()), this, SLOT(slotConfigDrivers ()) ); ++ connect( pactionInstallDriver , SIGNAL(triggered()), this, SLOT(slotInstallDriver ()) ); ++ connect( pactionInstallDriverEx , SIGNAL(triggered()), this, SLOT(slotInstallDriverEx ()) ); ++ connect( pactionGetInstalledDrivers , SIGNAL(triggered()), this, SLOT(slotGetInstalledDrivers ()) ); ++ connect( pactionRemoveDriverManager , SIGNAL(triggered()), this, SLOT(slotRemoveDriverManager ()) ); ++ connect( pactionInstallDriverManager , SIGNAL(triggered()), this, SLOT(slotInstallDriverManager ()) ); ++ connect( pactionReadFileDSN , SIGNAL(triggered()), this, SLOT(slotReadFileDSN ()) ); ++ connect( pactionWriteFileDSN , SIGNAL(triggered()), this, SLOT(slotWriteFileDSN ()) ); ++ connect( pactionWritePrivateProfileString, SIGNAL(triggered()), this, SLOT(slotWritePrivateProfileString()) ); ++ connect( pactionGetPrivateProfileString , SIGNAL(triggered()), this, SLOT(slotGetPrivateProfileString ()) ); ++ connect( pactionInstallTranslator , SIGNAL(triggered()), this, SLOT(slotInstallTranslator ()) ); ++ connect( pactionInstallTranslatorEx , SIGNAL(triggered()), this, SLOT(slotInstallTranslatorEx ()) ); ++ connect( pactionRemoveTranslator , SIGNAL(triggered()), this, SLOT(slotRemoveTranslator ()) ); ++ connect( pactionGetTranslator , SIGNAL(triggered()), this, SLOT(slotGetTranslator ()) ); ++ connect( pactionSetConfigMode , SIGNAL(triggered()), this, SLOT(slotSetConfigMode ()) ); ++ connect( pactionGetConfigMode , SIGNAL(triggered()), this, SLOT(slotGetConfigMode ()) ); ++ connect( pactionOptions , SIGNAL(triggered()), this, SLOT(slotOptions ()) ); ++ connect( pactionTrace , SIGNAL(triggered()), this, SLOT(slotTrace ()) ); ++ connect( pactionManageTestSources , SIGNAL(triggered()), this, SLOT(slotManageTestSources ()) ); ++ connect( pactionManageAutoTests , SIGNAL(triggered()), this, SLOT(slotManageAutoTests ()) ); ++ connect( pactionManageTestGroups , SIGNAL(triggered()), this, SLOT(slotManageTestGroups ()) ); ++ connect( pactionRunAutoTests , SIGNAL(triggered()), this, SLOT(slotRunAutoTests ()) ); ++ connect( pactionHelpTest , SIGNAL(triggered()), this, SLOT(slotHelpTest ()) ); ++ connect( pactionHelpApi , SIGNAL(triggered()), this, SLOT(slotHelpApi ()) ); ++ connect( pactionHelpAbout , SIGNAL(triggered()), this, SLOT(slotHelpAbout ()) ); ++ ++} ++ ++void OdbcTest::createMenus() ++{ ++ // File... ++ pmenuFile = menuBar()->addMenu( tr("&File") ); ++ pmenuFile->addAction( pactionExit ); ++ ++ // Diagnostic... ++ pmenuDiagnostic = menuBar()->addMenu( tr("Dia&gnostic") ); ++ pmenuDiagnostic->addAction( pactionGetDiagRec ); ++ pmenuDiagnostic->addAction( pactionGetDiagField ); ++ pmenuDiagnostic->addAction( pactionError ); ++ pmenuDiagnostic->addSeparator(); ++ pmenuDiagnostic->addAction( pactionErrorsAll ); ++ ++ // Environment... ++ pmenuEnvironment = menuBar()->addMenu( tr("E&nvironment") ); ++ pmenuEnvironment->addAction( pactionAllocEnv ); ++ pmenuEnvironment->addAction( pactionAllocHandle ); ++ pmenuEnvironment->addAction( pactionDataSources ); ++ pmenuEnvironment->addAction( pactionDrivers ); ++ pmenuEnvironment->addAction( pactionFreeEnv ); ++ pmenuEnvironment->addAction( pactionFreeHandle ); ++ pmenuEnvironment->addAction( pactionEndTran ); ++ pmenuEnvironment->addAction( pactionTransact ); ++ pmenuEnvironment->addSeparator(); ++ pmenuEnvironment->addAction( pactionDataSourcesAll ); ++ pmenuEnvironment->addAction( pactionDriversAll ); ++ ++ // Connection... ++ pmenuConnection = menuBar()->addMenu( tr("&Connection") ); ++ pmenuConnection->addAction( pactionAllocConnect ); ++ pmenuConnection->addAction( pactionBrowseConnect ); ++ pmenuConnection->addAction( pactionConnect ); ++ pmenuConnection->addAction( pactionDriverConnect ); ++ pmenuConnection->addAction( pactionDisconnect ); ++ pmenuConnection->addAction( pactionFreeConnect ); ++ pmenuConnection->addAction( pactionGetFunctions ); ++ pmenuConnection->addAction( pactionGetInfo ); ++ pmenuConnection->addAction( pactionNativeSql ); ++ pmenuConnection->addSeparator(); ++ pmenuConnection->addAction( pactionFullConnect ); ++ pmenuConnection->addAction( pactionFullDisconnect ); ++ pmenuConnection->addAction( pactionGetInfoAll ); ++ pmenuConnection->addAction( pactionGetFunctionsAll ); ++ ++ // Descriptor... ++ pmenuDescriptor = menuBar()->addMenu( tr("&Descriptor") ); ++ pmenuDescriptor->addAction( pactionCopyDesc ); ++ pmenuDescriptor->addAction( pactionGetDescField ); ++ pmenuDescriptor->addAction( pactionGetDescRec ); ++ pmenuDescriptor->addAction( pactionSetDescField ); ++ pmenuDescriptor->addAction( pactionSetDescRec ); ++ pmenuDescriptor->addSeparator(); ++ pmenuDescriptor->addAction( pactionGetDescAll ); ++ ++ // Statement... ++ pmenuStatement = menuBar()->addMenu( tr("&Statement") ); ++ pmenuStatement->addAction( pactionAllocStmt ); ++ pmenuStatement->addAction( pactionBindParam ); ++ pmenuStatement->addAction( pactionBindParameter ); ++ pmenuStatement->addAction( pactionCancel ); ++ pmenuStatement->addAction( pactionCloseCursor ); ++ pmenuStatement->addAction( pactionDescribeParam ); ++ pmenuStatement->addAction( pactionExecute ); ++ pmenuStatement->addAction( pactionExecDirect ); ++ pmenuStatement->addAction( pactionFreeStmt ); ++ pmenuStatement->addAction( pactionGetCursorName ); ++ pmenuStatement->addAction( pactionNumParams ); ++ pmenuStatement->addAction( pactionParamData ); ++ pmenuStatement->addAction( pactionParamOptions ); ++ pmenuStatement->addAction( pactionPrepare ); ++ pmenuStatement->addAction( pactionPutData ); ++ pmenuStatement->addAction( pactionSetCursorName ); ++ pmenuStatement->addSeparator(); ++ pmenuStatement->addAction( pactionFillParam ); ++ pmenuStatement->addAction( pactionShowParam ); ++ pmenuStatement->addAction( pactionShowCursorSettings ); ++ ++ // Attributes... ++ pmenuAttributes = menuBar()->addMenu( tr("&Attributes") ); ++ pmenuAttributes->addAction( pactionSetStmtAttr ); ++ pmenuAttributes->addAction( pactionGetStmtAttr ); ++ pmenuAttributes->addAction( pactionSetStmtOption ); ++ pmenuAttributes->addAction( pactionGetStmtOption ); ++ pmenuAttributes->addSeparator(); ++ pmenuAttributes->addAction( pactionSetConnectAttr ); ++ pmenuAttributes->addAction( pactionGetConnectAttr ); ++ pmenuAttributes->addAction( pactionSetConnectOption ); ++ pmenuAttributes->addAction( pactionGetConnectOption ); ++ pmenuAttributes->addSeparator(); ++ pmenuAttributes->addAction( pactionSetEnvAttr ); ++ pmenuAttributes->addAction( pactionGetEnvAttr ); ++ pmenuAttributes->addAction( pactionSetCursorAttributes ); ++ ++ // Results... ++ pmenuResults = menuBar()->addMenu( tr("&Results") ); ++ pmenuResults->addAction( pactionBindCol ); ++ pmenuResults->addAction( pactionBulkOperations ); ++ pmenuResults->addAction( pactionColAttributes ); ++ pmenuResults->addAction( pactionColAttribute ); ++ pmenuResults->addAction( pactionDescribeCol ); ++ pmenuResults->addAction( pactionExtendedFetch ); ++ pmenuResults->addAction( pactionFetch ); ++ pmenuResults->addAction( pactionFetchScroll ); ++ pmenuResults->addAction( pactionGetData ); ++ pmenuResults->addAction( pactionMoreResults ); ++ pmenuResults->addAction( pactionNumResultCols ); ++ pmenuResults->addAction( pactionRowCount ); ++ pmenuResults->addAction( pactionSetPos ); ++ pmenuResults->addAction( pactionSetScrollOptions ); ++ pmenuResults->addSeparator(); ++ pmenuResults->addAction( pactionBindColAll ); ++ pmenuResults->addAction( pactionDescribeColAll ); ++ pmenuResults->addAction( pactionFetchAll ); ++ pmenuResults->addAction( pactionGetDataAll ); ++ pmenuResults->addAction( pactionShowBoundCols ); ++ pmenuResults->addAction( pactionDisplayRowSet ); ++ ++ // Catalog... ++ pmenuCatalog = menuBar()->addMenu( tr("Cata&log") ); ++ pmenuCatalog->addAction( pactionColumns ); ++ pmenuCatalog->addAction( pactionColumnPrivileges ); ++ pmenuCatalog->addAction( pactionGetTypeInfo ); ++ pmenuCatalog->addAction( pactionForeignKeys ); ++ pmenuCatalog->addAction( pactionPrimaryKeys ); ++ pmenuCatalog->addAction( pactionProcedures ); ++ pmenuCatalog->addAction( pactionProcedureColumns ); ++ pmenuCatalog->addAction( pactionSpecialColumns ); ++ pmenuCatalog->addAction( pactionStatistics ); ++ pmenuCatalog->addAction( pactionTables ); ++ pmenuCatalog->addAction( pactionTablePrivileges ); ++ ++ // Installer... ++ pmenuInstaller = menuBar()->addMenu( tr("&Installer") ); ++ ++ // Installer->Data Sources... ++ pmenuDataSources = pmenuInstaller->addMenu( tr("DataSources") ); ++ pmenuDataSources->addAction( pactionManageDataSources ); ++ pmenuDataSources->addAction( pactionRemoveDefaultDataSource ); ++ pmenuDataSources->addAction( pactionConfigDataSource ); ++ pmenuDataSources->addAction( pactionCreateDataSource ); ++ pmenuDataSources->addAction( pactionValidDSN ); ++ pmenuDataSources->addAction( pactionRemoveDSNFromIni ); ++ pmenuDataSources->addAction( pactionWriteDSNToIni ); ++ ++ // Installer->Drivers... ++ pmenuDrivers = pmenuInstaller->addMenu( tr("Drivers") ); ++ pmenuDrivers->addAction( pactionRemoveDrivers ); ++ pmenuDrivers->addAction( pactionConfigDrivers ); ++ pmenuDrivers->addAction( pactionInstallDriver ); ++ pmenuDrivers->addAction( pactionInstallDriverEx ); ++ pmenuDrivers->addAction( pactionGetInstalledDrivers ); ++ ++ // Installer->DriverManager... ++ pmenuDriverManager = pmenuInstaller->addMenu( tr("DriverManager") ); ++ pmenuDriverManager->addAction( pactionRemoveDriverManager ); ++ pmenuDriverManager->addAction( pactionInstallDriverManager ); ++ ++ // Installer->DataSourceName... ++ pmenuFileDataSourceName = pmenuInstaller->addMenu( tr("FileDataSourceName") ); ++ pmenuFileDataSourceName->addAction( pactionReadFileDSN ); ++ pmenuFileDataSourceName->addAction( pactionWriteFileDSN ); ++ ++ // Installer->ProfileStrings... ++ pmenuProfileStrings = pmenuInstaller->addMenu( tr("ProfileStrings") ); ++ pmenuProfileStrings->addAction( pactionWritePrivateProfileString ); ++ pmenuProfileStrings->addAction( pactionGetPrivateProfileString ); ++ ++ // Installer->Translator... ++ pmenuTranslator = pmenuInstaller->addMenu( tr("Translator") ); ++ pmenuTranslator->addAction( pactionInstallTranslator ); ++ pmenuTranslator->addAction( pactionInstallTranslatorEx ); ++ pmenuTranslator->addAction( pactionRemoveTranslator ); ++ pmenuTranslator->addAction( pactionGetTranslator ); ++ ++ // Installer->ConfigMode... ++ pmenuConfigMode = pmenuInstaller->addMenu( tr("ConfigMode") ); ++ pmenuConfigMode->addAction( pactionSetConfigMode ); ++ pmenuConfigMode->addAction( pactionGetConfigMode ); ++ ++ // Tools... ++ pmenuTools = menuBar()->addMenu( tr("&Tools") ); ++ pmenuTools->addAction( pactionOptions ); ++ pmenuTools->addAction( pactionTrace ); ++ pmenuTools->addSeparator(); ++ pmenuTools->addAction( pactionManageTestSources ); ++ pmenuTools->addAction( pactionManageAutoTests ); ++ pmenuTools->addAction( pactionManageTestGroups ); ++ pmenuTools->addAction( pactionRunAutoTests ); ++ ++ // Help... ++ pmenuHelp = menuBar()->addMenu( tr("&Help") ); ++ pmenuHelp->addAction( pactionHelpTest ); ++ pmenuHelp->addAction( pactionHelpApi ); ++ pmenuHelp->addAction( pactionHelpAbout ); ++} ++ ++void OdbcTest::readApplicationState() ++{ ++ QSettings settings( "unixODBC-GUI-Qt", "OdbcTestQ4" ); ++ ++ settings.beginGroup( "MainWindow" ); ++ resize(settings.value( "size", QSize( 400, 400 ) ).toSize() ); ++ move(settings.value( "pos", QPoint( 200, 200 ) ).toPoint() ); ++ settings.endGroup(); ++} ++ ++void OdbcTest::writeApplicationState() ++{ ++ QSettings settings( "unixODBC-GUI-Qt", "OdbcTestQ4" ); ++ ++ settings.beginGroup( "MainWindow" ); ++ settings.setValue( "size", size() ); ++ settings.setValue( "pos", pos() ); ++ settings.endGroup(); ++} ++ ++void OdbcTest::slotAllocHandle() ++{ ++ DlgEnvAllocHandle *dlg = new DlgEnvAllocHandle( this, "SQLAllocHandle" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDataSources() ++{ ++ DlgEnvDataSources *dlg = new DlgEnvDataSources( this, "SQLDataSources" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDrivers() ++{ ++ DlgEnvDrivers *dlg = new DlgEnvDrivers( this, "SQLDrivers" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotEndTran() ++{ ++ DlgEnvEndTran *dlg = new DlgEnvEndTran( this, "SQLEndTran" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFreeHandle() ++{ ++ DlgEnvFreeHandle *dlg = new DlgEnvFreeHandle( this, "SQLFreeHandle" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotAllocEnv() ++{ ++ DlgEnvAllocEnv *dlg = new DlgEnvAllocEnv( this, "SQLAllocEnv" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFreeEnv() ++{ ++ DlgEnvFreeEnv *dlg = new DlgEnvFreeEnv( this, "SQLFreeEnv" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotTransact() ++{ ++ DlgEnvTransact *dlg = new DlgEnvTransact( this, "SQLTransact" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDataSourcesAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotDriversAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ +diff --git a/unixODBC-2.3.7/tests/OdbcTest.h b/unixODBC-2.3.7/tests/OdbcTest.h +new file mode 100644 +index 0000000..e75dd8a +--- /dev/null ++++ b/unixODBC-2.3.7/tests/OdbcTest.h +@@ -0,0 +1,362 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++/*! ++ * \brief Main application class for ODBCTestQ4. ++ * ++ * This contains or invokes all of our functionality. This is ++ * instantiated in main(). ++ * ++ */ ++class OdbcTest : public QMainWindow ++{ ++ Q_OBJECT ++public: ++ OdbcTest( QWidget *parent=0 ); ++ ~OdbcTest(); ++ ++ QSettings * pSettings; // an ini file usually called Gator.ini where we store configuration for our tests ++ ++ QSplitter *split; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ ++ QList listHandle; // \todo free these up in a destructor ++ const char *return_as_text( int ret ); ++ void fill_list_box( attr_value *attr, QComboBox *lst ); ++ void fill_list_box( attr_options *attr, QComboBox *lst ); ++ void fill_dsn_list( QComboBox *box ); ++ void set_dsn_list( QComboBox *box, const QString &stringItem ); ++ void dumpError( int type, SQLHANDLE ); ++ OdbcHandle *fill_handle_list( int type, QComboBox *lst ); ++ OdbcHandle *extract_handle_list( int type, QComboBox *lst ); ++ const char *int_type_as_string( SQLINTERVAL ); ++ SQLHANDLE get_handle( int type ); ++ void getInfoOdbc( SQLHANDLE dbc = SQL_NULL_HANDLE ); ++ void getDataStmt( SQLHANDLE hstmt = SQL_NULL_HANDLE ); ++ ++public slots: ++ // slots for our actions... ++ void slotExit(); ++ void slotGetDiagRec(); ++ void slotGetDiagField(); ++ void slotError(); ++ void slotErrorsAll(); ++ void slotAllocEnv(); ++ void slotAllocHandle(); ++ void slotDataSources(); ++ void slotDrivers(); ++ void slotFreeEnv(); ++ void slotFreeHandle(); ++ void slotEndTran(); ++ void slotTransact(); ++ void slotDataSourcesAll(); ++ void slotDriversAll(); ++ void slotAllocConnect(); ++ void slotBrowseConnect(); ++ void slotConnect(); ++ void slotDriverConnect(); ++ void slotDisconnect(); ++ void slotFreeConnect(); ++ void slotGetFunctions(); ++ void slotGetInfo(); ++ void slotNativeSql(); ++ void slotFullConnect(); ++ void slotFullDisconnect(); ++ void slotGetInfoAll(); ++ void slotGetFunctionsAll(); ++ void slotCopyDesc(); ++ void slotGetDescField(); ++ void slotGetDescRec(); ++ void slotSetDescField(); ++ void slotSetDescRec(); ++ void slotGetDescAll(); ++ void slotAllocStmt(); ++ void slotBindParam(); ++ void slotBindParameter(); ++ void slotCancel(); ++ void slotCloseCursor(); ++ void slotDescribeParam(); ++ void slotExecute(); ++ void slotExecDirect(); ++ void slotFreeStmt(); ++ void slotGetCursorName(); ++ void slotNumParams(); ++ void slotParamData(); ++ void slotParamOptions(); ++ void slotPrepare(); ++ void slotPutData(); ++ void slotSetCursorName(); ++ void slotFillParam(); ++ void slotShowParam(); ++ void slotShowCursorSettings(); ++ void slotSetStmtAttr(); ++ void slotGetStmtAttr(); ++ void slotSetStmtOption(); ++ void slotGetStmtOption(); ++ void slotSetConnectAttr(); ++ void slotGetConnectAttr(); ++ void slotSetConnectOption(); ++ void slotGetConnectOption(); ++ void slotSetEnvAttr(); ++ void slotGetEnvAttr(); ++ void slotSetCursorAttributes(); ++ void slotBindCol(); ++ void slotBulkOperations(); ++ void slotColAttributes(); ++ void slotColAttribute(); ++ void slotDescribeCol(); ++ void slotExtendedFetch(); ++ void slotFetch(); ++ void slotFetchScroll(); ++ void slotGetData(); ++ void slotMoreResults(); ++ void slotNumResultCols(); ++ void slotRowCount(); ++ void slotSetPos(); ++ void slotSetScrollOptions(); ++ void slotBindColAll(); ++ void slotDescribeColAll(); ++ void slotFetchAll(); ++ void slotGetDataAll(); ++ void slotShowBoundCols(); ++ void slotDisplayRowSet(); ++ void slotColumns(); ++ void slotColumnPrivileges(); ++ void slotGetTypeInfo(); ++ void slotForeignKeys(); ++ void slotPrimaryKeys(); ++ void slotProcedures(); ++ void slotProcedureColumns(); ++ void slotSpecialColumns(); ++ void slotStatistics(); ++ void slotTables(); ++ void slotTablePrivileges(); ++ void slotManageDataSources(); ++ void slotRemoveDefaultDataSource(); ++ void slotConfigDataSource(); ++ void slotCreateDataSource(); ++ void slotValidDSN(); ++ void slotRemoveDSNFromIni(); ++ void slotWriteDSNToIni(); ++ void slotRemoveDrivers(); ++ void slotConfigDrivers(); ++ void slotInstallDriver(); ++ void slotInstallDriverEx(); ++ void slotGetInstalledDrivers(); ++ void slotRemoveDriverManager(); ++ void slotInstallDriverManager(); ++ void slotReadFileDSN(); ++ void slotWriteFileDSN(); ++ void slotWritePrivateProfileString(); ++ void slotGetPrivateProfileString(); ++ void slotInstallTranslator(); ++ void slotInstallTranslatorEx(); ++ void slotRemoveTranslator(); ++ void slotGetTranslator(); ++ void slotSetConfigMode(); ++ void slotGetConfigMode(); ++ void slotOptions(); ++ void slotTrace(); ++ void slotManageTestSources(); ++ void slotManageAutoTests(); ++ void slotManageTestGroups(); ++ void slotRunAutoTests(); ++ void slotHelpTest(); ++ void slotHelpApi(); ++ void slotHelpAbout(); ++ ++protected: ++ void resizeEvent( QResizeEvent * ); ++ ++signals: ++ void explain( const QString& ); ++ ++private: ++ QLabel *label; ++ ++ QMenu* pmenuFile; ++ QMenu* pmenuDiagnostic; ++ QMenu* pmenuEnvironment; ++ QMenu* pmenuConnection; ++ QMenu* pmenuDescriptor; ++ QMenu* pmenuStatement; ++ QMenu* pmenuAttributes; ++ QMenu* pmenuResults; ++ QMenu* pmenuCatalog; ++ QMenu* pmenuDataSources; ++ QMenu* pmenuDrivers; ++ QMenu* pmenuDriverManager; ++ QMenu* pmenuFileDataSourceName; ++ QMenu* pmenuProfileStrings; ++ QMenu* pmenuTranslator; ++ QMenu* pmenuConfigMode; ++ QMenu* pmenuInstaller; ++ QMenu* pmenuTools; ++ QMenu* pmenuHelp; ++ ++ QAction* pactionExit; ++ QAction* pactionGetDiagRec; ++ QAction* pactionGetDiagField; ++ QAction* pactionError; ++ QAction* pactionErrorsAll; ++ QAction* pactionAllocEnv; ++ QAction* pactionAllocHandle; ++ QAction* pactionDataSources; ++ QAction* pactionDrivers; ++ QAction* pactionFreeEnv; ++ QAction* pactionFreeHandle; ++ QAction* pactionEndTran; ++ QAction* pactionTransact; ++ QAction* pactionDataSourcesAll; ++ QAction* pactionDriversAll; ++ QAction* pactionAllocConnect; ++ QAction* pactionBrowseConnect; ++ QAction* pactionConnect; ++ QAction* pactionDriverConnect; ++ QAction* pactionDisconnect; ++ QAction* pactionFreeConnect; ++ QAction* pactionGetFunctions; ++ QAction* pactionGetInfo; ++ QAction* pactionNativeSql; ++ QAction* pactionFullConnect; ++ QAction* pactionFullDisconnect; ++ QAction* pactionGetInfoAll; ++ QAction* pactionGetFunctionsAll; ++ QAction* pactionCopyDesc; ++ QAction* pactionGetDescField; ++ QAction* pactionGetDescRec; ++ QAction* pactionSetDescField; ++ QAction* pactionSetDescRec; ++ QAction* pactionGetDescAll; ++ QAction* pactionAllocStmt; ++ QAction* pactionBindParam; ++ QAction* pactionBindParameter; ++ QAction* pactionCancel; ++ QAction* pactionCloseCursor; ++ QAction* pactionDescribeParam; ++ QAction* pactionExecute; ++ QAction* pactionExecDirect; ++ QAction* pactionFreeStmt; ++ QAction* pactionGetCursorName; ++ QAction* pactionNumParams; ++ QAction* pactionParamData; ++ QAction* pactionParamOptions; ++ QAction* pactionPrepare; ++ QAction* pactionPutData; ++ QAction* pactionSetCursorName; ++ QAction* pactionFillParam; ++ QAction* pactionShowParam; ++ QAction* pactionShowCursorSettings; ++ QAction* pactionSetStmtAttr; ++ QAction* pactionGetStmtAttr; ++ QAction* pactionSetStmtOption; ++ QAction* pactionGetStmtOption; ++ QAction* pactionSetConnectAttr; ++ QAction* pactionGetConnectAttr; ++ QAction* pactionSetConnectOption; ++ QAction* pactionGetConnectOption; ++ QAction* pactionSetEnvAttr; ++ QAction* pactionGetEnvAttr; ++ QAction* pactionSetCursorAttributes; ++ QAction* pactionBindCol; ++ QAction* pactionBulkOperations; ++ QAction* pactionColAttributes; ++ QAction* pactionColAttribute; ++ QAction* pactionDescribeCol; ++ QAction* pactionExtendedFetch; ++ QAction* pactionFetch; ++ QAction* pactionFetchScroll; ++ QAction* pactionGetData; ++ QAction* pactionMoreResults; ++ QAction* pactionNumResultCols; ++ QAction* pactionRowCount; ++ QAction* pactionSetPos; ++ QAction* pactionSetScrollOptions; ++ QAction* pactionBindColAll; ++ QAction* pactionDescribeColAll; ++ QAction* pactionFetchAll; ++ QAction* pactionGetDataAll; ++ QAction* pactionShowBoundCols; ++ QAction* pactionDisplayRowSet; ++ QAction* pactionColumns; ++ QAction* pactionColumnPrivileges; ++ QAction* pactionGetTypeInfo; ++ QAction* pactionForeignKeys; ++ QAction* pactionPrimaryKeys; ++ QAction* pactionProcedures; ++ QAction* pactionProcedureColumns; ++ QAction* pactionSpecialColumns; ++ QAction* pactionStatistics; ++ QAction* pactionTables; ++ QAction* pactionTablePrivileges; ++ QAction* pactionManageDataSources; ++ QAction* pactionRemoveDefaultDataSource; ++ QAction* pactionConfigDataSource; ++ QAction* pactionCreateDataSource; ++ QAction* pactionValidDSN; ++ QAction* pactionRemoveDSNFromIni; ++ QAction* pactionWriteDSNToIni; ++ QAction* pactionRemoveDrivers; ++ QAction* pactionConfigDrivers; ++ QAction* pactionInstallDriver; ++ QAction* pactionInstallDriverEx; ++ QAction* pactionGetInstalledDrivers; ++ QAction* pactionRemoveDriverManager; ++ QAction* pactionInstallDriverManager; ++ QAction* pactionReadFileDSN; ++ QAction* pactionWriteFileDSN; ++ QAction* pactionWritePrivateProfileString; ++ QAction* pactionGetPrivateProfileString; ++ QAction* pactionInstallTranslator; ++ QAction* pactionInstallTranslatorEx; ++ QAction* pactionRemoveTranslator; ++ QAction* pactionGetTranslator; ++ QAction* pactionSetConfigMode; ++ QAction* pactionGetConfigMode; ++ QAction* pactionOptions; ++ QAction* pactionTrace; ++ QAction* pactionManageTestSources; ++ QAction* pactionManageAutoTests; ++ QAction* pactionManageTestGroups; ++ QAction* pactionRunAutoTests; ++ QAction* pactionHelpTest; ++ QAction* pactionHelpApi; ++ QAction* pactionHelpAbout; ++ ++ void createActions(); ++ void createMenus(); ++ void readApplicationState(); ++ void writeApplicationState(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/README b/unixODBC-2.3.7/tests/README +new file mode 100644 +index 0000000..31e54b3 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/README +@@ -0,0 +1,27 @@ +++-------------------------------------------------------------+ ++| ODBCTestQ4 | +++-------------------------------------------------------------+ ++ ++README ++--------------------------------------------------------------- ++ ++Description: ++ ++ This is a program which allows menu driven execution of ++ ODBC calls. This program also allows 'auto tests' to be ++ executed. ++ ++ This program has been created to provide similar ++ functionality as the MS odbctst32.exe program. ++ ++Authors: ++ ++ This program was created by Nick Gorham and then heavily ++ modified by Peter Harvey during a pure Qt4 port. Some ++ features may not be ported at this time. ++ ++--------------------------------------------------------------- ++Peter Harvey ++ ++ ++ +diff --git a/unixODBC-2.3.7/tests/attr.cpp b/unixODBC-2.3.7/tests/attr.cpp +new file mode 100644 +index 0000000..417b023 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/attr.cpp +@@ -0,0 +1,2958 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "attr.h" ++#include "OdbcTest.h" ++ ++static attr_value strlen_options[] = ++{ ++ { "SQL_NTS", SQL_NTS, NULL, 0 }, ++ { "SQL_IS_POINTER", SQL_IS_POINTER, NULL, 0 }, ++ { "SQL_IS_UINTEGER", SQL_IS_UINTEGER, NULL, 0 }, ++ { "SQL_IS_INTEGER", SQL_IS_INTEGER, NULL, 0 }, ++ { "SQL_IS_USMALLINT", SQL_IS_USMALLINT, NULL, 0 }, ++ { "SQL_IS_SMALLINT", SQL_IS_SMALLINT, NULL, 0 }, ++ { "", 0, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++static attr_options stmt_options[] = ++{ ++ { ++ "SQL_ATTR_APP_PARAM_DESC", SQL_ATTR_APP_PARAM_DESC, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ ++ { ++ "SQL_ATTR_APP_ROW_DESC", SQL_ATTR_APP_ROW_DESC, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ASYNC_ENABLE", SQL_ATTR_ASYNC_ENABLE, ++ { ++ { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF, NULL, 0 }, ++ { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_CONCURRENCY", SQL_ATTR_CONCURRENCY, ++ { ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, NULL, 0 }, ++ { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK, NULL, 0 }, ++ { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER, NULL, 0 }, ++ { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_CURSOR_SCROLLABLE", SQL_ATTR_CURSOR_SCROLLABLE, ++ { ++ { "SQL_NONSCROLLABLE", SQL_NONSCROLLABLE, NULL, 0 }, ++ { "SQL_SCROLLABLE", SQL_SCROLLABLE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_CURSOR_SENSITIVITY", SQL_ATTR_CURSOR_SENSITIVITY, ++ { ++ { "SQL_UNSPECIFIED", SQL_UNSPECIFIED, NULL, 0 }, ++ { "SQL_INSENSITIVE", SQL_INSENSITIVE, NULL, 0 }, ++ { "SQL_SENSITIVE", SQL_SENSITIVE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_CURSOR_TYPE", SQL_ATTR_CURSOR_TYPE, ++ { ++ { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY, NULL, 0 }, ++ { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC, NULL, 0 }, ++ { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN, NULL, 0 }, ++ { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ENABLE_AUTO_IPD", SQL_ATTR_ENABLE_AUTO_IPD, ++ { ++ { "SQL_FALSE", SQL_FALSE, NULL, 0 }, ++ { "SQL_TRUE", SQL_TRUE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_FETCH_BOOKMARK_PTR", SQL_ATTR_FETCH_BOOKMARK_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_FETCH_IMP_PARAM_DESC", SQL_ATTR_IMP_PARAM_DESC, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_FETCH_IMP_ROW_DESC", SQL_ATTR_IMP_ROW_DESC, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_KEYSET_SIZE", SQL_ATTR_KEYSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_MAX_LENGTH", SQL_ATTR_MAX_LENGTH, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_MAX_ROWS", SQL_ATTR_MAX_ROWS, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_METADATA_ID", SQL_ATTR_METADATA_ID, ++ { ++ { "SQL_FALSE", SQL_FALSE, NULL, 0 }, ++ { "SQL_TRUE", SQL_TRUE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_NOSCAN", SQL_ATTR_NOSCAN, ++ { ++ { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF, NULL, 0 }, ++ { "SQL_NOSCAN_ON", SQL_NOSCAN_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_PARAM_BIND_OFFSET_PTR", SQL_ATTR_PARAM_BIND_OFFSET_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_PARAM_BIND_TYPE", SQL_ATTR_PARAM_BIND_TYPE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_PARAM_OPERATION_PTR", SQL_ATTR_PARAM_OPERATION_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_SMALLINT, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_PARAM_STATUS_PTR", SQL_ATTR_PARAM_STATUS_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_SMALLINT, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_PARAMS_PROCESSED_PTR", SQL_ATTR_PARAMS_PROCESSED_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_SMALLINT, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_PARAMSET_SIZE", SQL_ATTR_PARAMSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_QUERY_TIMEOUT", SQL_ATTR_QUERY_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_RETRIEVE_DATA", SQL_ATTR_RETRIEVE_DATA, ++ { ++ { "SQL_RD_ON", SQL_RD_ON, NULL, 0 }, ++ { "SQL_RD_OFF", SQL_RD_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ROW_ARRAY_SIZE", SQL_ATTR_ROW_ARRAY_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ROW_BIND_OFFSET_PTR", SQL_ATTR_ROW_BIND_OFFSET_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_ROW_BIND_TYPE", SQL_ATTR_ROW_BIND_TYPE, ++ { ++ { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ROW_NUMBER", SQL_ATTR_ROW_NUMBER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_ROW_OPERATION_PTR", SQL_ATTR_ROW_OPERATION_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_SMALLINT, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_ROW_STATUS_PTR", SQL_ATTR_ROW_STATUS_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_SMALLINT, FALSE, TRUE ++ }, ++ { ++ "SQL_ATTR_ROWS_FETCHED_PTR", SQL_ATTR_ROWS_FETCHED_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, ++ "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_SIMULATE_CURSOR", SQL_ATTR_SIMULATE_CURSOR, ++ { ++ { "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE, NULL, 0 }, ++ { "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE, NULL, 0 }, ++ { "SQL_SC_UNIQUE", SQL_SC_UNIQUE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { ++ "SQL_ATTR_USE_BOOKMARKS", SQL_ATTR_USE_BOOKMARKS, ++ { ++ { "SQL_UB_ON", SQL_UB_ON, NULL, 0 }, ++ { "SQL_UB_OFF", SQL_UB_OFF, NULL, 0 }, ++ { "SQL_UB_VARIABLE", SQL_UB_VARIABLE,NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, ++ "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options stmt_opt_options[] = ++{ ++ { "SQL_ASYNC_ENABLE", SQL_ASYNC_ENABLE, ++ { ++ { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF, NULL, 0 }, ++ { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BIND_TYPE", SQL_BIND_TYPE, ++ { ++ { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CONCURRENCY", SQL_CONCURRENCY, ++ { ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, NULL, 0 }, ++ { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK, NULL, 0 }, ++ { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER, NULL, 0 }, ++ { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES, NULL, 0 }, ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CURSOR_TYPE", SQL_CURSOR_TYPE, ++ { ++ { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY, NULL, 0 }, ++ { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC, NULL, 0 }, ++ { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN, NULL, 0 }, ++ { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_KEYSET_SIZE", SQL_KEYSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_LENGTH", SQL_MAX_LENGTH, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_ROWS", SQL_MAX_ROWS, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_NOSCAN", SQL_NOSCAN, ++ { ++ { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF, NULL, 0 }, ++ { "SQL_NOSCAN_ON", SQL_NOSCAN_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_QUERY_TIMEOUT", SQL_QUERY_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_RETRIEVE_DATA", SQL_RETRIEVE_DATA, ++ { ++ { "SQL_RD_ON", SQL_RD_ON, NULL, 0 }, ++ { "SQL_RD_OFF", SQL_RD_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ROWSET_SIZE", SQL_ROWSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_SIMULATE_CURSOR", SQL_SIMULATE_CURSOR, ++ { ++ { "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE, NULL, 0 }, ++ { "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE, NULL, 0 }, ++ { "SQL_SC_UNIQUE", SQL_SC_UNIQUE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_USE_BOOKMARKS", SQL_USE_BOOKMARKS, ++ { ++ { "SQL_UB_ON", SQL_UB_ON, NULL, 0 }, ++ { "SQL_UB_OFF", SQL_UB_OFF, NULL, 0 }, ++ { "SQL_UB_VARIABLE", SQL_UB_VARIABLE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options conn_options[] = ++{ ++ { "SQL_ATTR_ACCESS_MODE", SQL_ATTR_ACCESS_MODE, ++ { ++ { "SQL_MODE_READ_WRITE", SQL_MODE_READ_WRITE, NULL, 0 }, ++ { "SQL_MODE_READ_ONLY", SQL_MODE_READ_ONLY, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_ASYNC_ENABLE", SQL_ATTR_ASYNC_ENABLE, ++ { ++ { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF, NULL, 0 }, ++ { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_AUTO_IPD", SQL_ATTR_AUTO_IPD, ++ { ++ { "SQL_TRUE", SQL_TRUE, NULL, 0 }, ++ { "SQL_FALSE", SQL_FALSE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_AUTOCOMMIT", SQL_ATTR_AUTOCOMMIT, ++ { ++ { "SQL_AUTOCOMMIT_ON", SQL_AUTOCOMMIT_ON, NULL, 0 }, ++ { "SQL_AUTOCOMMIT_OFF", SQL_AUTOCOMMIT_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_CONNECTION_TIMEOUT", SQL_ATTR_CONNECTION_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_CURRENT_CATALOG", SQL_ATTR_CURRENT_CATALOG, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ATTR_LOGIN_TIMEOUT", SQL_ATTR_LOGIN_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_METADATA_ID", SQL_ATTR_METADATA_ID, ++ { ++ { "SQL_TRUE", SQL_TRUE, NULL, 0 }, ++ { "SQL_FALSE", SQL_FALSE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_ODBC_CURSORS", SQL_ATTR_ODBC_CURSORS, ++ { ++#ifdef SQL_CUR_USE_IF_NEEDED ++ { "SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED, NULL, 0 }, ++#endif ++#ifdef SQL_CUR_USE_ODBC ++ { "SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC, NULL, 0 }, ++#endif ++ { "SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_PACKET_SIZE", SQL_ATTR_PACKET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_QUIET_MODE", SQL_ATTR_QUIET_MODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_TRACE", SQL_ATTR_TRACE, ++ { ++ { "SQL_OPT_TRACE_OFF", SQL_OPT_TRACE_OFF, NULL, 0 }, ++ { "SQL_OPT_TRACE_ON", SQL_OPT_TRACE_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_TRACEFILE", SQL_ATTR_TRACEFILE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ATTR_TRANSLATE_LIB", SQL_ATTR_TRANSLATE_LIB, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ATTR_TRANSLATE_OPTION", SQL_ATTR_TRANSLATE_OPTION, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_TXN_ISOLATION", SQL_ATTR_TXN_ISOLATION, ++ { ++ { "SQL_TXN_READ_UNCOMMITTED", SQL_TXN_READ_UNCOMMITTED, NULL, 0 }, ++ { "SQL_TXN_READ_COMMITTED", SQL_TXN_READ_COMMITTED, NULL, 0 }, ++ { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ, NULL, 0 }, ++ { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options conn_opt_options[] = ++{ ++ { "conn: SQL_ACCESS_MODE", SQL_ACCESS_MODE, ++ { ++ { "SQL_MODE_READ_ONLY", SQL_MODE_READ_ONLY, NULL, 0 }, ++ { "SQL_MODE_READ_WRITE", SQL_MODE_READ_WRITE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_AUTOCOMMIT", SQL_AUTOCOMMIT, ++ { ++ { "SQL_AUTOCOMMIT_ON", SQL_AUTOCOMMIT_ON, NULL, 0 }, ++ { "SQL_AUTOCOMMIT_OFF", SQL_AUTOCOMMIT_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_CURRENT_QUALIFIER", SQL_CURRENT_QUALIFIER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "conn: SQL_LOGIN_TIMEOUT", SQL_LOGIN_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_ODBC_CURSORS", SQL_ODBC_CURSORS, ++ { ++#ifdef SQL_CUR_USE_IF_NEEDED ++ { "SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED, NULL, 0 }, ++#endif ++#ifdef SQL_CUR_USE_ODBC ++ { "SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC, NULL, 0 }, ++#endif ++ { "SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_OPT_TRACE", SQL_OPT_TRACE, ++ { ++ { "SQL_OPT_TRACE_ON", SQL_OPT_TRACE_ON, NULL, 0 }, ++ { "SQL_OPT_TRACE_OFF", SQL_OPT_TRACE_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_OPT_TRACEFILE", SQL_OPT_TRACEFILE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "conn: SQL_PACKET_SIZE", SQL_PACKET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_QUIET_MODE", SQL_QUIET_MODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_TRANSLATE_DLL", SQL_TRANSLATE_DLL, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "conn: SQL_TRANSLATE_OPTION", SQL_TRANSLATE_OPTION, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "conn: SQL_TXN_ISOLATION", SQL_TXN_ISOLATION, ++ { ++ { "SQL_TXN_READ_UNCOMMITED", SQL_TXN_READ_UNCOMMITTED, NULL, 0 }, ++ { "SQL_TXN_READ_COMMITED", SQL_TXN_READ_COMMITTED, NULL, 0 }, ++ { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ, NULL, 0 }, ++ { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE, NULL, 0 }, ++ { "SQL_TXN_VERSIONING", 0x00000010L, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_ASYNC_ENABLE", SQL_ASYNC_ENABLE, ++ { ++ { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF, NULL, 0 }, ++ { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_BIND_TYPE", SQL_BIND_TYPE, ++ { ++ { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_CONCURRENCY", SQL_CONCURRENCY, ++ { ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, NULL, 0 }, ++ { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK, NULL, 0 }, ++ { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER, NULL, 0 }, ++ { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES, NULL, 0 }, ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_CURSOR_TYPE", SQL_CURSOR_TYPE, ++ { ++ { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY, NULL, 0 }, ++ { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC, NULL, 0 }, ++ { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN, NULL, 0 }, ++ { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_KEYSET_SIZE", SQL_KEYSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_MAX_LENGTH", SQL_MAX_LENGTH, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_MAX_ROWS", SQL_MAX_ROWS, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_NOSCAN", SQL_NOSCAN, ++ { ++ { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF, NULL, 0 }, ++ { "SQL_NOSCAN_ON", SQL_NOSCAN_ON, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_QUERY_TIMEOUT", SQL_QUERY_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_RETRIEVE_DATA", SQL_RETRIEVE_DATA, ++ { ++ { "SQL_RD_ON", SQL_RD_ON, NULL, 0 }, ++ { "SQL_RD_OFF", SQL_RD_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_ROWSET_SIZE", SQL_ROWSET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_SIMULATE_CURSOR", SQL_SIMULATE_CURSOR, ++ { ++ { "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE, NULL, 0 }, ++ { "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE, NULL, 0 }, ++ { "SQL_SC_UNIQUE", SQL_SC_UNIQUE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "stmt: SQL_USE_BOOKMARKS", SQL_USE_BOOKMARKS, ++ { ++ { "SQL_UB_ON", SQL_UB_ON, NULL, 0 }, ++ { "SQL_UB_OFF", SQL_UB_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options conn_gopt_options[] = ++{ ++ { "SQL_ACCESS_MODE", SQL_ACCESS_MODE, ++ { ++ { "SQL_MODE_READ_ONLY", SQL_MODE_READ_ONLY, NULL, 0 }, ++ { "SQL_MODE_READ_WRITE", SQL_MODE_READ_WRITE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_AUTOCOMMIT", SQL_AUTOCOMMIT, ++ { ++ { "SQL_AUTOCOMMIT_ON", SQL_AUTOCOMMIT_ON, NULL, 0 }, ++ { "SQL_AUTOCOMMIT_OFF", SQL_AUTOCOMMIT_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CURRENT_QUALIFIER", SQL_CURRENT_QUALIFIER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_LOGIN_TIMEOUT", SQL_LOGIN_TIMEOUT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ODBC_CURSORS", SQL_ODBC_CURSORS, ++ { ++#ifdef SQL_CUR_USE_IF_NEEDED ++ { "SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED, NULL, 0 }, ++#endif ++#ifdef SQL_CUR_USE_ODBC ++ { "SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC, NULL, 0 }, ++#endif ++ { "SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_OPT_TRACE", SQL_OPT_TRACE, ++ { ++ { "SQL_OPT_TRACE_ON", SQL_OPT_TRACE_ON, NULL, 0 }, ++ { "SQL_OPT_TRACE_OFF", SQL_OPT_TRACE_OFF, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_OPT_TRACEFILE", SQL_OPT_TRACEFILE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_PACKET_SIZE", SQL_PACKET_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_QUIET_MODE", SQL_QUIET_MODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TRANSLATE_DLL", SQL_TRANSLATE_DLL, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_TRANSLATE_OPTION", SQL_TRANSLATE_OPTION, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TXN_ISOLATION", SQL_TXN_ISOLATION, ++ { ++ { "SQL_TXN_READ_UNCOMMITED", SQL_TXN_READ_UNCOMMITTED, NULL, 0 }, ++ { "SQL_TXN_READ_COMMITED", SQL_TXN_READ_COMMITTED, NULL, 0 }, ++ { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ, NULL, 0 }, ++ { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE, NULL, 0 }, ++ { "SQL_TXN_VERSIONING", 0x00000010L, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options env_options[] = ++{ ++ { "SQL_ATTR_ODBC_VERSION", SQL_ATTR_ODBC_VERSION, ++ { ++ { "SQL_OV_ODBC2", SQL_OV_ODBC2, NULL, 0 }, ++ { "SQL_OV_ODBC3", SQL_OV_ODBC3, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_CP_MATCH", SQL_ATTR_CP_MATCH, ++ { ++ { "SQL_CP_STRICT_MATCH", SQL_CP_STRICT_MATCH, NULL, 0 }, ++ { "SQL_CP_RELAXED_MATCH", SQL_CP_RELAXED_MATCH, NULL, 0 }, ++ { "SQL_CP_MATCH_DEFAULT", SQL_CP_MATCH_DEFAULT, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_CONNECTION_POOLING", SQL_ATTR_CONNECTION_POOLING, ++ { ++ { "SQL_CP_OFF", SQL_OV_ODBC2, NULL, 0 }, ++ { "SQL_CP_ONE_PER_DRIVER", SQL_CP_ONE_PER_DRIVER, NULL, 0 }, ++ { "SQL_CP_ONE_PER_HENV", SQL_CP_ONE_PER_HENV, NULL, 0 }, ++ { "SQL_CP_DEFAULT", SQL_CP_DEFAULT, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ATTR_OUTPUT_NTS", SQL_ATTR_OUTPUT_NTS, ++ { ++ { "SQL_TRUE", SQL_TRUE, NULL, 0 }, ++ { "SQL_FALSE", SQL_FALSE, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++void dSetEnvAttr::Activated( int index ) ++{ ++ value->clear(); ++ ++ pOdbcTest->fill_list_box( env_options[ index ].values, value ); ++} ++ ++void dSetEnvAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HENV; ++ SQLINTEGER attribute; ++ SQLPOINTER vptr; ++ SQLINTEGER string_length; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetEnvAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Environment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = env_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ env_options[ types->currentIndex() ].text, ++ env_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ vptr = (SQLPOINTER) env_options[ types->currentIndex() ].values[ value->currentIndex() ].value; ++ txt.sprintf( " Value: %s=%d", ++ env_options[ types->currentIndex() ].values[ value->currentIndex() ].text, ++ env_options[ types->currentIndex() ].values[ value->currentIndex() ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ string_length = strlen_options[ stringlen->currentIndex() ].value; ++ txt.sprintf( " String Length: %s=%d", ++ strlen_options[ stringlen->currentIndex() ].text, ++ strlen_options[ stringlen->currentIndex() ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetEnvAttr( in_handle, attribute, vptr, string_length ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetEnvAttr::dSetEnvAttr( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Environment Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( env_options, types ); ++ ++ value = new QComboBox( this ); // "Value" ++ value->setGeometry( 170, 110, 300, 20 ); ++ pOdbcTest->fill_list_box( env_options[ 0 ].values, value ); ++ ++ stringlen = new QComboBox( this ); // "String Length" ++ stringlen->setGeometry( 170, 140, 300, 20 ); ++ pOdbcTest->fill_list_box( strlen_options, stringlen ); ++ ++ l_handle = new QLabel( "Environment Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ l_value = new QLabel( "Value:", this ); ++ l_value->setGeometry( 10, 110, 130, 20 ); ++ ++ l_slen = new QLabel( "String Length:", this ); ++ l_slen->setGeometry( 10, 140, 130, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( types, SIGNAL(activated(int)), this, SLOT( Activated(int))); ++} ++ ++dSetEnvAttr::~dSetEnvAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete value; ++ delete stringlen; ++ delete l_handle; ++ delete l_types; ++ delete l_value; ++ delete l_slen; ++} ++ ++void dGetEnvAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HENV; ++ SQLINTEGER attribute; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLINTEGER b_len, strlen_or_ind; ++ SQLINTEGER *strlen_ptr; ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetEnvAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Environment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = env_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ env_options[ types->currentIndex() ].text, ++ env_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( target_valid->isChecked() ) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new char[ 300 ]; ++ } ++ else ++ { ++ buf = new char[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " Value Ptr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Value Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ strlen_or_ind = -999999; ++ ++ if ( strlen_valid->isChecked() ) ++ { ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_or_ind; ++ } ++ ++ if ( strlen_ptr ) ++ { ++ txt.sprintf( " Strlen Ptr: %p", strlen_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Strlen Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetEnvAttr( in_handle, attribute, ++ buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( strlen_ptr ) ++ { ++ if ( strlen_or_ind == -999999 ) ++ { ++ txt.sprintf( " *Strlen Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Strlen Ptr: %d", strlen_or_ind ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ int index = types->currentIndex(); ++ switch ( env_options[ index ].data_type ) ++ { ++ case SQL_INTEGER: ++ SQLUINTEGER ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ txt.sprintf( " *ValuePtr = %d (0x%08X)", ival, ival ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( env_options[ index ].values[ 0 ].text ) ++ { ++ if ( env_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; env_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( env_options[ index ].values[ i ].value & ival ) ++ { ++ txt.sprintf( " %s", ++ env_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; env_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( (SQLUINTEGER)(env_options[ index ].values[ i ].value) == ival ) ++ { ++ txt.sprintf( " %s", ++ env_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ ++ case SQL_SMALLINT: ++ SQLSMALLINT sval; ++ memcpy( &sval, buf, sizeof( sval )); ++ txt.sprintf( " *ValuePtr = %d (0x%04X)", sval, sval ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( env_options[ index ].values[ 0 ].text ) ++ { ++ if ( env_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; env_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( env_options[ index ].values[ i ].value & sval ) ++ { ++ txt.sprintf( " %s", ++ env_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; env_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( env_options[ index ].values[ i ].value == sval ) ++ { ++ txt.sprintf( " %s", ++ env_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetEnvAttr::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "ValuePtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "ValuePtr: VALID" ); ++} ++ ++void dGetEnvAttr::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLen_Ptr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLen_Ptr: VALID" ); ++} ++ ++dGetEnvAttr::dGetEnvAttr( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Environment Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( env_options, types ); ++ ++ l_handle = new QLabel( "Environment Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ target_valid = new QCheckBox( "ValuePtr: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLen_Ptr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); // "Buffer Len" ++ buffer_len->setGeometry( 400, 110, 70, 20 ); ++ buffer_len->setMaxLength( 7 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 110, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dGetEnvAttr::~dGetEnvAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete target_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dSetStmtAttr::Activated( int index ) ++{ ++ value->clear(); ++ ++ if ( !stmt_options[ index ].values[ 0 ].text ) ++ { ++ switch ( stmt_options[ index ].attr ) ++ { ++ case SQL_ATTR_FETCH_BOOKMARK_PTR: ++ case SQL_ATTR_PARAM_BIND_OFFSET_PTR: ++ case SQL_ATTR_PARAM_OPERATION_PTR: ++ case SQL_ATTR_PARAM_STATUS_PTR: ++ case SQL_ATTR_PARAMS_PROCESSED_PTR: ++ case SQL_ATTR_ROW_BIND_OFFSET_PTR: ++ case SQL_ATTR_ROW_OPERATION_PTR: ++ case SQL_ATTR_ROW_STATUS_PTR: ++ case SQL_ATTR_ROWS_FETCHED_PTR: ++ value->insertItem( 0, "" ); ++ break; ++ ++ default: ++ value->insertItem( 0, "0" ); ++ break; ++ } ++ } ++ else ++ { ++ pOdbcTest->fill_list_box( stmt_options[ index ].values, value ); ++ } ++} ++ ++void dSetStmtAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HSTMT; ++ SQLINTEGER attribute; ++ SQLPOINTER vptr; ++ SQLUINTEGER ival = 0; ++ const char *tptr; ++ attr_value *ptr; ++ SQLINTEGER string_length; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ QString qtptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetStmtAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statment Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = stmt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ stmt_options[ types->currentIndex() ].text, ++ stmt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qtptr = value->currentText(); ++ tptr = qtptr.toUtf8().constData(); ++ ++ /* ++ * try and match the text ++ */ ++ ++ for ( ptr = stmt_options[ types->currentIndex() ].values; ++ ptr->text; ptr ++ ) ++ { ++ if ( strncmp( ptr->text, tptr, strlen( ptr->text )) == 0 ) ++ { ++ break; ++ } ++ } ++ ++ if ( !ptr->text ) ++ { ++ if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE || ++ attribute == SQL_ATTR_PARAMSET_SIZE ) ++ { ++ ival = atoi( tptr ); ++ } ++ ++ vptr = (SQLPOINTER) atoi( tptr ); ++ txt.sprintf( " Value: %d", atoi( tptr )); ++ } ++ else ++ { ++ if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE || ++ attribute == SQL_ATTR_PARAMSET_SIZE ) ++ { ++ ival = ptr->value; ++ } ++ ++ vptr = (SQLPOINTER) ptr->value; ++ txt.sprintf( " Value: %s=%d", ptr->text, ptr->value ); ++ } ++ ++ if ( strcmp( tptr, "" ) == 0 ) ++ { ++ switch ( stmt_options[ types->currentIndex() ].attr ) ++ { ++ case SQL_ATTR_FETCH_BOOKMARK_PTR: ++ vptr = hand->bookmark_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_PARAM_BIND_OFFSET_PTR: ++ vptr = hand->param_bind_offset_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_PARAM_OPERATION_PTR: ++ vptr = hand->param_opt_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_PARAM_STATUS_PTR: ++ vptr = hand->param_status_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_PARAMS_PROCESSED_PTR: ++ vptr = hand->params_processed_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_ROW_BIND_OFFSET_PTR: ++ vptr = hand->row_bind_offset_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_ROW_OPERATION_PTR: ++ vptr = hand->row_operation_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_ROW_STATUS_PTR: ++ vptr = hand->row_status_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ ++ case SQL_ATTR_ROWS_FETCHED_PTR: ++ vptr = hand->rows_fetched_ptr; ++ txt.sprintf( " Value: %p", vptr ); ++ break; ++ } ++ } ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ string_length = strlen_options[ stringlen->currentIndex() ].value; ++ txt.sprintf( " String Length: %s=%d", ++ strlen_options[ stringlen->currentIndex() ].text, ++ strlen_options[ stringlen->currentIndex() ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetStmtAttr( in_handle, attribute, vptr, string_length ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++ ++ /* ++ * save the row or param array size ++ */ ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE ) ++ { ++ hand->row_array_size = ival; ++ } ++ else if ( attribute == SQL_ATTR_PARAMSET_SIZE ) ++ { ++ hand->param_array_size = ival; ++ } ++ } ++} ++ ++dSetStmtAttr::dSetStmtAttr( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Statement Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( stmt_options, types ); ++ ++ value = new QComboBox( this ); // "Value" ++ value->setGeometry( 170, 110, 300, 20 ); ++ pOdbcTest->fill_list_box( stmt_options[ 0 ].values, value ); ++ ++ stringlen = new QComboBox( this ); // "String Length" ++ stringlen->setGeometry( 170, 140, 300, 20 ); ++ pOdbcTest->fill_list_box( strlen_options, stringlen ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ l_value = new QLabel( "Value:", this ); ++ l_value->setGeometry( 10, 110, 130, 20 ); ++ ++ l_slen = new QLabel( "String Length:", this ); ++ l_slen->setGeometry( 10, 140, 130, 20 ); ++ ++ Activated( 0 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( types, SIGNAL(activated(int)), this, SLOT( Activated(int))); ++} ++ ++dSetStmtAttr::~dSetStmtAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete value; ++ delete stringlen; ++ delete l_handle; ++ delete l_types; ++ delete l_value; ++ delete l_slen; ++} ++ ++void dSetStmtOption::Activated( int index ) ++{ ++ value->clear(); ++ ++ if ( !stmt_opt_options[ index ].values[ 0 ].text ) ++ { ++ value->insertItem( 0, "0" ); ++ } ++ else ++ { ++ pOdbcTest->fill_list_box( stmt_opt_options[ index ].values, value ); ++ } ++} ++ ++void dSetStmtOption::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HSTMT; ++ SQLINTEGER attribute; ++ SQLINTEGER ival = 0; ++ SQLULEN vptr; ++ const char *tptr; ++ attr_value *ptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ QString qtptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetStmtOption():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " hstmt: %p", in_handle ); ++ else ++ txt.sprintf( " hstmt: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = stmt_opt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " fOption: %s=%d", ++ stmt_opt_options[ types->currentIndex() ].text, ++ stmt_opt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qtptr = value->currentText(); ++ tptr = qtptr.toUtf8().constData(); ++ ++ /* ++ * try and match the text ++ */ ++ ++ for ( ptr = stmt_opt_options[ types->currentIndex() ].values; ++ ptr->text; ptr ++ ) ++ { ++ if ( strncmp( ptr->text, tptr, strlen( ptr->text )) == 0 ) ++ { ++ break; ++ } ++ } ++ ++ if ( !ptr->text ) ++ { ++ vptr = (SQLULEN) atoi( tptr ); ++ txt.sprintf( " vParam: %d", atoi( tptr )); ++ if ( attribute == SQL_ROWSET_SIZE ) ++ { ++ ival = atoi( tptr ); ++ } ++ } ++ else ++ { ++ vptr = (SQLULEN) ptr->value; ++ txt.sprintf( " vParam: %s=%d", ptr->text, ptr->value ); ++ if ( attribute == SQL_ROWSET_SIZE ) ++ { ++ ival = ptr->value; ++ } ++ } ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetStmtOption( in_handle, attribute, vptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++ ++ /* ++ * save the row or param array size ++ */ ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( attribute == SQL_ROWSET_SIZE ) ++ { ++ hand->row_array_size = ival; ++ } ++ } ++} ++ ++dSetStmtOption::dSetStmtOption( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Statement Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( stmt_opt_options, types ); ++ ++ value = new QComboBox( this ); // "Value" ++ value->setGeometry( 170, 110, 300, 20 ); ++ pOdbcTest->fill_list_box( stmt_opt_options[ 0 ].values, value ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "fOption:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ l_value = new QLabel( "vParam:", this ); ++ l_value->setGeometry( 10, 110, 130, 20 ); ++ ++ Activated( 0 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( types, SIGNAL(activated(int)), this, SLOT( Activated(int))); ++} ++ ++dSetStmtOption::~dSetStmtOption() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete value; ++ delete l_handle; ++ delete l_types; ++ delete l_value; ++} ++ ++void dGetStmtAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HENV; ++ SQLINTEGER attribute; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLINTEGER b_len, strlen_or_ind; ++ SQLINTEGER *strlen_ptr; ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetStmtAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = stmt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ stmt_options[ types->currentIndex() ].text, ++ stmt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new char[ 300 ]; ++ } ++ else ++ { ++ buf = new char[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " Value Ptr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Value Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ strlen_or_ind = -999999; ++ ++ if ( strlen_valid->isChecked()) ++ { ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_or_ind; ++ } ++ ++ if ( strlen_ptr ) ++ { ++ txt.sprintf( " Strlen Ptr: %p", strlen_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Strlen Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetStmtAttr( in_handle, attribute, ++ buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( strlen_ptr ) ++ { ++ if ( strlen_or_ind == -999999 ) ++ { ++ txt.sprintf( " *Strlen Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Strlen Ptr: %d", strlen_or_ind ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ int index = types->currentIndex(); ++ ++ if ( stmt_options[ index ].is_pointer ) ++ { ++ void *ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ txt.sprintf( " ValuePtr = 0x%08X", ival ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ switch ( stmt_options[ index ].data_type ) ++ { ++ case SQL_INTEGER: ++ SQLUINTEGER ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ txt.sprintf( " *ValuePtr = %d (0x%08X)", ival, ival ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( stmt_options[ index ].values[ 0 ].text ) ++ { ++ if ( stmt_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; stmt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( stmt_options[ index ].values[ i ].value & ival ) ++ { ++ txt.sprintf( " %s", ++ stmt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; stmt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( (SQLUINTEGER)(stmt_options[ index ].values[ i ].value) == ival ) ++ { ++ txt.sprintf( " %s", ++ stmt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ ++ case SQL_SMALLINT: ++ SQLSMALLINT sval; ++ memcpy( &sval, buf, sizeof( sval )); ++ txt.sprintf( " *ValuePtr = %d (0x%04X)", sval, sval ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( stmt_options[ index ].values[ 0 ].text ) ++ { ++ if ( stmt_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; stmt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( stmt_options[ index ].values[ i ].value & sval ) ++ { ++ txt.sprintf( " %s", ++ stmt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; stmt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( stmt_options[ index ].values[ i ].value == sval ) ++ { ++ txt.sprintf( " %s", ++ stmt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ } ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetStmtAttr::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "ValuePtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "ValuePtr: VALID" ); ++} ++ ++void dGetStmtAttr::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLen_Ptr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLen_Ptr: VALID" ); ++} ++ ++dGetStmtAttr::dGetStmtAttr( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Statement Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( stmt_options, types ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ target_valid = new QCheckBox( "ValuePtr: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLen_Ptr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); // "Buffer Len" ++ buffer_len->setGeometry( 400, 110, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 110, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dGetStmtAttr::~dGetStmtAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete target_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dGetStmtOption::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HENV; ++ SQLINTEGER attribute, value; ++ SQLPOINTER vptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ int index = types->currentIndex(); ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetStmtOption():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " hstmt: %p", in_handle ); ++ else ++ txt.sprintf( " hstmt: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = stmt_opt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " fOption: %s=%d", ++ stmt_opt_options[ types->currentIndex() ].text, ++ stmt_opt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ vptr = NULL; ++ } ++ else ++ { ++ if ( stmt_opt_options[ index ].data_type == SQL_INTEGER ) ++ { ++ vptr = &value; ++ } ++ else ++ { ++ buf = new char[ 300 ]; ++ vptr = buf; ++ } ++ } ++ ++ if ( vptr ) ++ { ++ txt.sprintf( " vParam: %p", vptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " vParam: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetStmtOption( in_handle, attribute, ++ vptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( vptr ) ++ { ++ switch ( stmt_opt_options[ index ].data_type ) ++ { ++ case SQL_INTEGER: ++ { ++ int i; ++ ++ txt.sprintf( " *vptr = 0x%08X", value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ for ( i = 0; stmt_opt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( stmt_opt_options[ index ].values[ i ].value == value ) ++ { ++ txt.sprintf( " %s", ++ stmt_opt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ break; ++ } ++ ++ default: ++ txt.sprintf( " *vptr = %s", buf ); ++ break; ++ } ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetStmtOption::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "vParam: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "vParam: VALID" ); ++} ++ ++dGetStmtOption::dGetStmtOption( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "hstmt" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ types = new QComboBox( this ); // "fOption" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( stmt_opt_options, types ); ++ ++ l_handle = new QLabel( "hstmt:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "fOption:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ target_valid = new QCheckBox( "vParam: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++} ++ ++dGetStmtOption::~dGetStmtOption() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete target_valid; ++} ++ ++void dSetConnAttr::Activated( int index ) ++{ ++ value->clear(); ++ ++ if ( !conn_options[ index ].values[ 0 ].text ) ++ { ++ if ( conn_options[ index ].data_type == SQL_CHAR ) ++ { ++ value->insertItem( 0, "" ); ++ value->insertItem( 1, "" ); ++ } ++ else ++ { ++ value->insertItem( 0, "0" ); ++ } ++ } ++ else ++ { ++ pOdbcTest->fill_list_box( conn_options[ index ].values, value ); ++ } ++} ++ ++void dSetConnAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HDBC; ++ SQLINTEGER attribute; ++ SQLPOINTER vptr; ++ SQLINTEGER string_length; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ attr_value *ptr; ++ const char *tptr; ++ QString qtptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetConnectAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = conn_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ conn_options[ types->currentIndex() ].text, ++ conn_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qtptr = value->currentText(); ++ tptr = qtptr.toUtf8().constData(); ++ ++ /* ++ * try and match the text ++ */ ++ ++ for ( ptr = conn_options[ types->currentIndex() ].values; ++ ptr->text; ptr ++ ) ++ { ++ if ( strncmp( ptr->text, tptr, strlen( ptr->text )) == 0 ) ++ { ++ break; ++ } ++ } ++ ++ if ( !ptr->text ) ++ { ++ if ( conn_options[ types->currentIndex() ].data_type == SQL_CHAR ) ++ { ++ vptr = (SQLPOINTER) tptr; ++ if ( strncmp( "", tptr, 14 ) == 0 ) ++ { ++ vptr = NULL; ++ txt.sprintf( " Value: SQL_NULL_POINTER" ); ++ } ++ else ++ { ++ vptr = (SQLPOINTER) tptr; ++ txt.sprintf( " Value: %s", tptr ); ++ } ++ } ++ else ++ { ++ vptr = (SQLPOINTER) atoi( tptr ); ++ txt.sprintf( " Value: %d", atoi( tptr )); ++ } ++ } ++ else ++ { ++ vptr = (SQLPOINTER) ptr->value; ++ txt.sprintf( " Value: %s=%d", ptr->text, ptr->value ); ++ } ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ string_length = strlen_options[ stringlen->currentIndex() ].value; ++ txt.sprintf( " String Length: %s=%d", ++ strlen_options[ stringlen->currentIndex() ].text, ++ strlen_options[ stringlen->currentIndex() ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetConnectAttr( in_handle, attribute, vptr, string_length ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetConnAttr::dSetConnAttr( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Connection Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( conn_options, types ); ++ ++ value = new QComboBox( this ); // "Value" ++ value->setGeometry( 170, 110, 300, 20 ); ++ pOdbcTest->fill_list_box( conn_options[ 0 ].values, value ); ++ ++ stringlen = new QComboBox( this ); // "String Length" ++ stringlen->setGeometry( 170, 140, 300, 20 ); ++ pOdbcTest->fill_list_box( strlen_options, stringlen ); ++ ++ l_handle = new QLabel( "Connection Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ l_value = new QLabel( "Value:", this ); ++ l_value->setGeometry( 10, 110, 130, 20 ); ++ ++ l_slen = new QLabel( "String Length:", this ); ++ l_slen->setGeometry( 10, 140, 130, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( types, SIGNAL(activated(int)), this, SLOT( Activated(int))); ++} ++ ++dSetConnAttr::~dSetConnAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete value; ++ delete stringlen; ++ delete l_handle; ++ delete l_types; ++ delete l_value; ++ delete l_slen; ++} ++ ++void dGetConnAttr::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HDBC; ++ SQLINTEGER attribute; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLINTEGER b_len, strlen_or_ind; ++ SQLINTEGER *strlen_ptr; ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetConnectAttr():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = conn_options[ types->currentIndex() ].attr; ++ txt.sprintf( " Attribute: %s=%d", ++ conn_options[ types->currentIndex() ].text, ++ conn_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = atoi( buffer_len->text().toUtf8().constData() ); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new char[ 300 ]; ++ } ++ else ++ { ++ buf = new char[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " Value Ptr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Value Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ strlen_or_ind = -999999; ++ ++ if ( strlen_valid->isChecked()) ++ { ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_or_ind; ++ } ++ ++ if ( strlen_ptr ) ++ { ++ txt.sprintf( " Strlen Ptr: %p", strlen_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Strlen Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetConnectAttr( in_handle, attribute, ++ buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( strlen_ptr ) ++ { ++ if ( strlen_or_ind == -999999 ) ++ { ++ txt.sprintf( " *Strlen Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Strlen Ptr: %d", strlen_or_ind ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ int index = types->currentIndex(); ++ switch ( conn_options[ index ].data_type ) ++ { ++ case SQL_CHAR: ++ txt.sprintf( " *InfoValuePtr = \"%s\"", buf ); ++ pOdbcTest->out_win->append( txt ); ++ break; ++ ++ case SQL_INTEGER: ++ SQLUINTEGER ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ txt.sprintf( " *ValuePtr = %d (0x%08X)", ival, ival ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( conn_options[ index ].values[ 0 ].text ) ++ { ++ if ( conn_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; conn_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( conn_options[ index ].values[ i ].value & ival ) ++ { ++ txt.sprintf( " %s", ++ conn_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; conn_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( (SQLUINTEGER)(conn_options[ index ].values[ i ].value) == ival ) ++ { ++ txt.sprintf( " %s", ++ conn_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ ++ case SQL_SMALLINT: ++ SQLSMALLINT sval; ++ memcpy( &sval, buf, sizeof( sval )); ++ txt.sprintf( " *ValuePtr = %d (0x%04X)", sval, sval ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( conn_options[ index ].values[ 0 ].text ) ++ { ++ if ( conn_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; conn_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( conn_options[ index ].values[ i ].value & sval ) ++ { ++ txt.sprintf( " %s", ++ conn_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; conn_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( conn_options[ index ].values[ i ].value == sval ) ++ { ++ txt.sprintf( " %s", ++ conn_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetConnAttr::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "ValuePtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "ValuePtr: VALID" ); ++} ++ ++void dGetConnAttr::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLen_Ptr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLen_Ptr: VALID" ); ++} ++ ++dGetConnAttr::dGetConnAttr( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Connection Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( conn_options, types ); ++ ++ l_handle = new QLabel( "Connection Handle:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "Attribute:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ target_valid = new QCheckBox( "ValuePtr: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLen_Ptr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); // "Buffer Len" ++ buffer_len->setGeometry( 400, 110, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 110, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dGetConnAttr::~dGetConnAttr() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete target_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dSetConnectOption::Activated( int index ) ++{ ++ value->clear(); ++ ++ if ( !conn_opt_options[ index ].values[ 0 ].text ) ++ { ++ if ( conn_opt_options[ index ].data_type == SQL_CHAR ) ++ { ++ value->insertItem( 0, "" ); ++ value->insertItem( 1, "" ); ++ } ++ else ++ { ++ value->insertItem( 0, "0" ); ++ } ++ } ++ else ++ { ++ pOdbcTest->fill_list_box( conn_opt_options[ index ].values, value ); ++ } ++} ++ ++void dSetConnectOption::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HDBC; ++ SQLINTEGER attribute; ++ SQLULEN vptr = 0; ++ const char *tptr; ++ attr_value *ptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ QString qtptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetConnectOption():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " hdbc: %p", in_handle ); ++ else ++ txt.sprintf( " hdbc: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = conn_opt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " fOption: %s=%d", ++ conn_opt_options[ types->currentIndex() ].text, ++ conn_opt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qtptr = value->currentText(); ++ tptr = qtptr.toUtf8().constData(); ++ ++ /* ++ * try and match the text ++ */ ++ ++ for ( ptr = conn_opt_options[ types->currentIndex() ].values; ++ ptr->text; ptr ++ ) ++ { ++ if ( strncmp( ptr->text, tptr, strlen( ptr->text )) == 0 ) ++ { ++ break; ++ } ++ } ++ if ( !ptr->text ) ++ { ++ // This can't be done on 64 bit with old definitions... ++ if ( conn_opt_options[ types->currentIndex() ].data_type == SQL_CHAR ) ++ { ++#if (SIZEOF_LONG_INT == 8) ++#ifndef DO_YOU_KNOW_WHAT_YOUR_ARE_DOING ++ fprintf( stderr, "unable to do this on this processor with 32 bit build options...\n" ); ++#else ++ vptr = (SQLULEN) tptr; ++#endif ++#else ++ vptr = (SQLULEN) tptr; ++#endif ++ if ( strncmp( "", tptr, 14 ) == 0 ) ++ { ++ vptr = 0; ++ txt.sprintf( " vParam: SQL_NULL_POINTER" ); ++ } ++ else ++ { ++#if (SIZEOF_LONG_INT == 8) ++#ifndef DO_YOU_KNOW_WHAT_YOUR_ARE_DOING ++ fprintf( stderr, "unable to do this on this processor with 32 bit build options...\n" ); ++#else ++ vptr = (SQLULEN) tptr; ++#endif ++#else ++ vptr = (SQLULEN) tptr; ++#endif ++ txt.sprintf( " vParam: %s", tptr ); ++ } ++ } ++ else ++ { ++ vptr = (SQLULEN) atoi( tptr ); ++ txt.sprintf( " vParam: %d", atoi( tptr )); ++ } ++ } ++ else ++ { ++ vptr = (SQLULEN) ptr->value; ++ txt.sprintf( " vParam: %s=%d", ptr->text, ptr->value ); ++ } ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetConnectOption( in_handle, attribute, vptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetConnectOption::dSetConnectOption( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Statement Handle" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ types = new QComboBox( this ); // "Attribute" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( conn_opt_options, types ); ++ ++ value = new QComboBox( this ); // "Value" ++ value->setGeometry( 170, 110, 300, 20 ); ++ pOdbcTest->fill_list_box( conn_opt_options[ 0 ].values, value ); ++ ++ l_handle = new QLabel( "hdbc:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "fOption:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ l_value = new QLabel( "vParam:", this ); ++ l_value->setGeometry( 10, 110, 130, 20 ); ++ ++ Activated( 0 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( types, SIGNAL(activated(int)), this, SLOT( Activated(int))); ++} ++ ++dSetConnectOption::~dSetConnectOption() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete value; ++ delete l_handle; ++ delete l_types; ++ delete l_value; ++} ++ ++void dGetConnectOption::Ok() ++{ ++ SQLHANDLE in_handle = SQL_NULL_HENV; ++ SQLINTEGER attribute, value; ++ SQLPOINTER vptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ int index = types->currentIndex(); ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetConnectOption():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " hdbc: %p", in_handle ); ++ else ++ txt.sprintf( " hdbc: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = conn_gopt_options[ types->currentIndex() ].attr; ++ txt.sprintf( " fOption: %s=%d", ++ conn_gopt_options[ types->currentIndex() ].text, ++ conn_gopt_options[ types->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ vptr = NULL; ++ } ++ else ++ { ++ if ( conn_gopt_options[ index ].data_type == SQL_INTEGER ) ++ { ++ vptr = &value; ++ } ++ else ++ { ++ buf = new char[ 300 ]; ++ vptr = buf; ++ } ++ } ++ ++ if ( vptr ) ++ { ++ txt.sprintf( " vParam: %p", vptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " vParam: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetConnectOption( in_handle, attribute, ++ vptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( vptr ) ++ { ++ switch ( conn_gopt_options[ index ].data_type ) ++ { ++ case SQL_INTEGER: ++ { ++ int i; ++ ++ txt.sprintf( " *vptr = 0x%08X", value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ for ( i = 0; conn_gopt_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( conn_gopt_options[ index ].values[ i ].value == value ) ++ { ++ txt.sprintf( " %s", ++ conn_gopt_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ break; ++ } ++ ++ default: ++ txt.sprintf( " *vptr = %s", buf ); ++ break; ++ } ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetConnectOption::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "vParam: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "vParam: VALID" ); ++} ++ ++dGetConnectOption::dGetConnectOption( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "hdbc" ++ handles->setGeometry( 170, 50, 300, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ types = new QComboBox( this ); // "fOption" ++ types->setGeometry( 170, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( conn_gopt_options, types ); ++ ++ l_handle = new QLabel( "hstmt:", this ); ++ l_handle->setGeometry( 10, 50, 130, 20 ); ++ ++ l_types = new QLabel( "fOption:", this ); ++ l_types->setGeometry( 10, 80, 130, 20 ); ++ ++ target_valid = new QCheckBox( "vParam: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++} ++ ++dGetConnectOption::~dGetConnectOption() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete types; ++ delete handles; ++ delete l_handle; ++ delete l_types; ++ delete target_valid; ++} ++ ++void OdbcTest::slotSetStmtAttr() ++{ ++ dSetStmtAttr *dlg = new dSetStmtAttr( this, "SQLSetStmtAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetStmtAttr() ++{ ++ dGetStmtAttr *dlg = new dGetStmtAttr( this, "SQLGetStmtAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetConnectAttr() ++{ ++ dSetConnAttr *dlg = new dSetConnAttr( this, "SQLSetConnectAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetConnectAttr() ++{ ++ dGetConnAttr *dlg = new dGetConnAttr( this, "SQLGetConnectAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetEnvAttr() ++{ ++ dSetEnvAttr *dlg = new dSetEnvAttr( this, "SQLSetEnvAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetEnvAttr() ++{ ++ dGetEnvAttr *dlg = new dGetEnvAttr( this, "SQLGetEnvAttr" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetStmtOption() ++{ ++ dSetStmtOption *dlg = new dSetStmtOption( this, "SQLSetStmtOption" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetStmtOption() ++{ ++ dGetStmtOption *dlg = new dGetStmtOption( this, "SQLGetStmtOption" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetConnectOption() ++{ ++ dSetConnectOption *dlg = new dSetConnectOption( this, "SQLSetConnectOption" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetConnectOption() ++{ ++ dGetConnectOption *dlg = new dGetConnectOption( this, "SQLGetConnectOption" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetCursorAttributes() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ +diff --git a/unixODBC-2.3.7/tests/attr.h b/unixODBC-2.3.7/tests/attr.h +new file mode 100644 +index 0000000..40aaf22 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/attr.h +@@ -0,0 +1,266 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dSetStmtAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetStmtAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dSetStmtAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types, *value, *stringlen; ++ QLabel *l_handle, *l_types, *l_value, *l_slen; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Activated( int index ); ++ void Ok(); ++}; ++ ++class dSetStmtOption : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetStmtOption( OdbcTest *pOdbcTest, QString name ); ++ ~dSetStmtOption(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types, *value; ++ QLabel *l_handle, *l_types, *l_value; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Activated( int index ); ++ void Ok(); ++}; ++ ++class dGetStmtOption : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetStmtOption( OdbcTest *pOdbcTest, QString name ); ++ ~dGetStmtOption(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *target_valid; ++ QLabel *l_handle, *l_types; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void Ok(); ++}; ++ ++class dGetStmtAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetStmtAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dGetStmtAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *target_valid, *strlen_valid; ++ QLabel *l_handle, *l_types, *l_buffer_len; ++ QLineEdit *buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dSetConnAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetConnAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dSetConnAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types, *value, *stringlen; ++ QLabel *l_handle, *l_types, *l_value, *l_slen; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Activated( int index ); ++ void Ok(); ++}; ++ ++class dGetConnAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetConnAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dGetConnAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *target_valid, *strlen_valid; ++ QLabel *l_handle, *l_types, *l_buffer_len; ++ QLineEdit *buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dSetConnectOption : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetConnectOption( OdbcTest *pOdbcTest, QString name ); ++ ~dSetConnectOption(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types, *value; ++ QLabel *l_handle, *l_types, *l_value; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Activated( int index ); ++ void Ok(); ++}; ++ ++class dGetConnectOption : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetConnectOption( OdbcTest *pOdbcTest, QString name ); ++ ~dGetConnectOption(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *target_valid; ++ QLabel *l_handle, *l_types; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void Ok(); ++}; ++ ++class dSetEnvAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetEnvAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dSetEnvAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types, *value, *stringlen; ++ QLabel *l_handle, *l_types, *l_value, *l_slen; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Activated( int index ); ++ void Ok(); ++}; ++ ++class dGetEnvAttr : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetEnvAttr( OdbcTest *pOdbcTest, QString name ); ++ ~dGetEnvAttr(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *types; ++ QCheckBox *target_valid, *strlen_valid; ++ QLabel *l_handle, *l_types, *l_buffer_len; ++ QLineEdit *buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/catalog.cpp b/unixODBC-2.3.7/tests/catalog.cpp +new file mode 100644 +index 0000000..04c1210 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/catalog.cpp +@@ -0,0 +1,3235 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "catalog.h" ++#include "OdbcTest.h" ++ ++static attr_options get_type_options[] = ++{ ++ { "SQL_ALL_TYPES", SQL_ALL_TYPES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CHAR", SQL_CHAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_VARCHAR", SQL_VARCHAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_LONGVARCHAR", SQL_LONGVARCHAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DECIMAL", SQL_DECIMAL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_NUMERIC", SQL_NUMERIC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_SMALLINT", SQL_SMALLINT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTEGER", SQL_INTEGER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_REAL", SQL_REAL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_FLOAT", SQL_FLOAT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DOUBLE", SQL_DOUBLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BIT", SQL_BIT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TINYINT", SQL_TINYINT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BIGINT", SQL_BIGINT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BINARY", SQL_BINARY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_VARBINARY", SQL_VARBINARY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_LONGVARBINARY", SQL_LONGVARBINARY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TYPE_DATE", SQL_TYPE_DATE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DATE", SQL_DATE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TYPE_TIME", SQL_TYPE_TIME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TIME", SQL_TIME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TYPE_TIMESTAMP", SQL_TYPE_TIMESTAMP, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_TIMESTAMP", SQL_TIMESTAMP, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_MONTH", SQL_INTERVAL_MONTH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_YEAR", SQL_INTERVAL_YEAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_YEAR_TO_MONTH", SQL_INTERVAL_YEAR_TO_MONTH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_DAY", SQL_INTERVAL_DAY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_HOUR", SQL_INTERVAL_HOUR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_MINUTE", SQL_INTERVAL_MINUTE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_SECOND", SQL_INTERVAL_SECOND, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_DAY_TO_HOUR", SQL_INTERVAL_DAY_TO_HOUR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_DAY_TO_MINUTE", SQL_INTERVAL_DAY_TO_MINUTE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_DAY_TO_SECOND", SQL_INTERVAL_DAY_TO_SECOND, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_HOUR_TO_MINUTE", SQL_INTERVAL_HOUR_TO_MINUTE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INTERVAL_HOUR_TO_SECOND", SQL_INTERVAL_HOUR_TO_SECOND, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++static attr_options unique_options[ 3 ] = ++{ ++ { "SQL_INDEX_UNIQUE", SQL_INDEX_UNIQUE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_INDEX_ALL", SQL_INDEX_ALL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++static attr_options reserved_options[ 3 ] = ++{ ++ { "SQL_QUICK", SQL_QUICK, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ENSURE", SQL_ENSURE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++static attr_options ident_options[ 3 ] = ++{ ++ { "SQL_BEST_ROWID", SQL_BEST_ROWID, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ROWVER", SQL_ROWVER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++static attr_options scope_options[ 4 ] = ++{ ++ { "SQL_SCOPE_CURROW", SQL_SCOPE_CURROW, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_SCOPE_TRANSACTION", SQL_SCOPE_TRANSACTION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_SCOPE_SESSION", SQL_SCOPE_SESSION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++static attr_options null_options[ 3 ] = ++{ ++ { "SQL_NO_NULLS", SQL_NO_NULLS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_NULLABLE", SQL_NULLABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0}, ++}; ++ ++void dTables::Ok() ++{ ++ QString stringLength; ++ ++ pOdbcTest->out_win->append( "SQLTables():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ // handle... ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE hStatement = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ hStatement = hand->getHandle(); ++ ++ if ( hStatement ) ++ pOdbcTest->out_win->append( QString( tr(" Statement Handle: %1") ).arg( (qulonglong)hStatement ) ); ++ else ++ pOdbcTest->out_win->append( tr(" Statement Handle: SQL_NULL_HSTMT") ); ++ ++ // catalog... ++ QString stringCatalog = catalog ->currentText(); ++ const char *pszCatalog = NULL; ++ if ( stringCatalog == "" || stringCatalog.isNull() ) ++ { ++ pszCatalog = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( stringCatalog == "" || stringCatalog.isEmpty() ) ++ { ++ pszCatalog = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( stringCatalog == "SQL_ALL_CATALOGS" ) ++ { ++ pszCatalog = SQL_ALL_CATALOGS; ++ pOdbcTest->out_win->append( QString( tr(" Type: SQL_ALL_CATALOGS=%1") ).arg( SQL_ALL_CATALOGS ) ); ++ } ++ else ++ { ++ pszCatalog = stringCatalog.toUtf8().constData(); ++ pOdbcTest->out_win->append( QString( tr(" Catalog: %1") ).arg( pszCatalog ) ); ++ } ++ ++ // catalog length... ++ stringLength = catalog_len ->currentText(); ++ SQLSMALLINT nCatalog = SQL_NTS; ++ if ( stringLength.left( 7 ) == "SQL_NTS" ) ++ { ++ nCatalog = SQL_NTS; ++ pOdbcTest->out_win->append( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ nCatalog = stringLength.toInt(); ++ pOdbcTest->out_win->append( QString( tr(" Catalog Len: %1") ).arg( nCatalog ) ); ++ } ++ ++ // schema... ++ QString stringSchema = schema->currentText(); ++ const char *pszSchema = NULL; ++ if ( stringSchema == "" || stringSchema.isNull() ) ++ { ++ pszSchema = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( stringSchema == "" || stringSchema.isEmpty() ) ++ { ++ pszSchema = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( stringSchema == "SQL_ALL_SCHEMAS" ) ++ { ++ pszSchema = SQL_ALL_SCHEMAS; ++ pOdbcTest->out_win->append( QString( tr(" Type: SQL_ALL_SCHEMAS=%1") ).arg( SQL_ALL_SCHEMAS ) ); ++ } ++ else ++ { ++ pszSchema = stringSchema.toUtf8().constData(); ++ pOdbcTest->out_win->append( QString( tr(" Schema: %1") ).arg( pszSchema ) ); ++ } ++ ++ // schema length... ++ stringLength = schema_len ->currentText(); ++ SQLSMALLINT nSchema = SQL_NTS; ++ if ( stringLength.left( 7 ) == "SQL_NTS" ) ++ { ++ nSchema = SQL_NTS; ++ pOdbcTest->out_win->append( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ nSchema = stringLength.toInt(); ++ pOdbcTest->out_win->append( QString( tr(" Schema Len: %1") ).arg( nSchema ) ); ++ } ++ ++ // table... ++ QString stringTable = table->currentText(); ++ const char *pszTable = NULL; ++ if ( stringTable == "" || stringTable.isNull() ) ++ { ++ pszTable = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( stringTable == "" || stringTable.isEmpty() ) ++ { ++ pszTable = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ pszTable = stringTable.toUtf8().constData(); ++ pOdbcTest->out_win->append( QString( tr(" Table: %1") ).arg( pszTable ) ); ++ } ++ ++ // table length... ++ stringLength = table_len ->currentText(); ++ SQLSMALLINT nTable = SQL_NTS; ++ if ( stringLength.left( 7 ) == "SQL_NTS" ) ++ { ++ nTable = SQL_NTS; ++ pOdbcTest->out_win->append( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ nTable = stringLength.toInt(); ++ pOdbcTest->out_win->append( QString( tr(" Table Len: %1") ).arg( nTable ) ); ++ } ++ ++ // type... ++ QString stringType = type->currentText(); ++ const char *pszType = NULL; ++ if ( stringType == "" || stringType.isNull() ) ++ { ++ pszType = NULL; ++ pOdbcTest->out_win->append( " Type: " ); ++ } ++ else if ( stringType == "" || stringType.isEmpty() ) ++ { ++ pszType = ""; ++ pOdbcTest->out_win->append( " Type: " ); ++ } ++ else if ( stringType == "SQL_ALL_TABLE_TYPES" ) ++ { ++ pszType = SQL_ALL_TABLE_TYPES; ++ pOdbcTest->out_win->append( QString( tr(" Type: SQL_ALL_TABLE_TYPES=%1") ).arg( SQL_ALL_TABLE_TYPES ) ); ++ } ++ else ++ { ++ pszType = stringType.toUtf8().constData(); ++ pOdbcTest->out_win->append( QString( tr(" Type: %1") ).arg( pszType ) ); ++ } ++ ++ // type length... ++ stringLength = type_len->currentText(); ++ SQLSMALLINT nType = SQL_NTS; ++ if ( stringLength.left( 7 ) == "SQL_NTS" ) ++ { ++ nType = SQL_NTS; ++ pOdbcTest->out_win->append( " Type Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ nType = stringLength.toInt(); ++ pOdbcTest->out_win->append( QString( tr(" Type Len: %1") ).arg( nType ) ); ++ } ++ ++ // do it... ++ SQLRETURN nReturn = SQLTables( hStatement, ++ (SQLCHAR*)pszCatalog, nCatalog, ++ (SQLCHAR*)pszSchema, nSchema, ++ (SQLCHAR*)pszTable, nTable, ++ (SQLCHAR*)pszType, nType ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ pOdbcTest->out_win->append( QString( tr(" %1=%2") ).arg( pOdbcTest->return_as_text( nReturn ) ).arg( nReturn ) ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dTables::dTables( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); // "Handle" ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); // "catalog" ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ catalog->insertItem( 2, "SQL_ALL_CATALOGS" ); ++ ++ schema = new QComboBox( this ); // "schema" ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ schema->insertItem( 2, "SQL_ALL_SCHEMAS" ); ++ ++ table = new QComboBox( this ); // "table" ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ /*! \todo consider getting from SQLGetInfo (with a fallback)... */ ++ type = new QComboBox( this ); // "table" ++ type->setEditable( true ); ++ type->setGeometry( 100, 140, 150, 20 ); ++ l_type = new QLabel( "Table Type:", this ); ++ l_type->setGeometry( 10, 140, 90, 20 ); ++ type->insertItem( 0, "" ); ++ type->insertItem( 1, "" ); ++ type->insertItem( 2, "SQL_ALL_TABLE_TYPES" ); ++ ++ catalog_len = new QComboBox( this ); // "catalog len" ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); // "schema len" ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); // "table len" ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ type_len = new QComboBox( this ); // "type len" ++ type_len->setEditable( true ); ++ type_len->setGeometry( 370, 140, 150, 20 ); ++ l_type_len = new QLabel( "String Length:", this ); ++ l_type_len->setGeometry( 280, 140, 90, 20 ); ++ type_len->insertItem( 0, "SQL_NTS=-3" ); ++ type_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dTables::~dTables() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete type; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete l_type; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete type_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete l_type_len; ++} ++ ++void dColumns::Ok() ++{ ++ const char *cat, *sch, *tab, *col; ++ const char *lcat, *lsch, *ltab, *lcol; ++ QString qcat, qsch, qtab, qcol; ++ QString qlcat, qlsch, qltab, qlcol; ++ int cat_len, sch_len, tab_len, col_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qcol = column ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ qlcol = column_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ col = qcol.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ lcol = qlcol.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLColumns():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( col, "" ) == 0 ) ++ { ++ col = NULL; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else if ( strcmp( col, "" ) == 0 ) ++ { ++ col = ""; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else ++ { ++ txt.sprintf( " Column: %s", col ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcol, "SQL_NTS", 7 ) == 0 ) ++ { ++ col_len = SQL_NTS; ++ txt.sprintf( " Column Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ col_len = atoi( lcol ); ++ txt.sprintf( " Column Len: %d", col_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLColumns( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ (SQLCHAR*)col, col_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dColumnPrivileges::Ok() ++{ ++ const char *cat, *sch, *tab, *col; ++ const char *lcat, *lsch, *ltab, *lcol; ++ QString qcat, qsch, qtab, qcol; ++ QString qlcat, qlsch, qltab, qlcol; ++ int cat_len, sch_len, tab_len, col_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qcol = column ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ qlcol = column_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ col = qcol.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ lcol = qlcol.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLColumnPrivileges():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( col, "" ) == 0 ) ++ { ++ col = NULL; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else if ( strcmp( col, "" ) == 0 ) ++ { ++ col = ""; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else ++ { ++ txt.sprintf( " Column: %s", col ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcol, "SQL_NTS", 7 ) == 0 ) ++ { ++ col_len = SQL_NTS; ++ txt.sprintf( " Column Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ col_len = atoi( lcol ); ++ txt.sprintf( " Column Len: %d", col_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLColumnPrivileges( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ (SQLCHAR*)col, col_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dColumnPrivileges::dColumnPrivileges( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ column = new QComboBox( this ); ++ column->setEditable( true ); ++ column->setGeometry( 100, 140, 150, 20 ); ++ l_column = new QLabel( "Column:", this ); ++ l_column->setGeometry( 10, 140, 90, 20 ); ++ column->insertItem( 0, "" ); ++ column->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ column_len = new QComboBox( this ); ++ column_len->setEditable( true ); ++ column_len->setGeometry( 370, 140, 150, 20 ); ++ l_column_len = new QLabel( "String Length:", this ); ++ l_column_len->setGeometry( 280, 140, 90, 20 ); ++ column_len->insertItem( 0, "SQL_NTS=-3" ); ++ column_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dColumnPrivileges::~dColumnPrivileges() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete column; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete l_column; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete column_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete l_column_len; ++} ++ ++dColumns::dColumns( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ column = new QComboBox( this ); ++ column->setEditable( true ); ++ column->setGeometry( 100, 140, 150, 20 ); ++ l_column = new QLabel( "Column:", this ); ++ l_column->setGeometry( 10, 140, 90, 20 ); ++ column->insertItem( 0, "" ); ++ column->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ column_len = new QComboBox( this ); ++ column_len->setEditable( true ); ++ column_len->setGeometry( 370, 140, 150, 20 ); ++ l_column_len = new QLabel( "String Length:", this ); ++ l_column_len->setGeometry( 280, 140, 90, 20 ); ++ column_len->insertItem( 0, "SQL_NTS=-3" ); ++ column_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dColumns::~dColumns() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete column; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete l_column; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete column_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete l_column_len; ++} ++ ++void dForeignKeys::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *fk_cat, *fk_sch, *fk_tab; ++ const char *lcat, *lsch, *ltab; ++ const char *fk_lcat, *fk_lsch, *fk_ltab; ++ QString qcat, qsch, qtab; ++ QString qfk_cat, qfk_sch, qfk_tab; ++ QString qlcat, qlsch, qltab; ++ QString qfk_lcat, qfk_lsch, qfk_ltab; ++ int cat_len, sch_len, tab_len; ++ int fk_cat_len, fk_sch_len, fk_tab_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ qfk_cat = fk_catalog ->currentText(); ++ qfk_sch = fk_schema ->currentText(); ++ qfk_tab = fk_table ->currentText(); ++ qfk_lcat = fk_catalog_len ->currentText(); ++ qfk_lsch = fk_schema_len ->currentText(); ++ qfk_ltab = fk_table_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ fk_cat = qfk_cat.toUtf8().constData(); ++ fk_sch = qfk_sch.toUtf8().constData(); ++ fk_tab = qfk_tab.toUtf8().constData(); ++ fk_lcat = qfk_lcat.toUtf8().constData(); ++ fk_lsch = qfk_lsch.toUtf8().constData(); ++ fk_ltab = qfk_ltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLForeignKeys():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " PKCatalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " PKCatalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " PKCatalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " PKCatalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " PKCatalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " PKSchema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " PKSchema: " ); ++ } ++ else ++ { ++ txt.sprintf( " PKSchema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " PKSchema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " PKSchema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " PKTable: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " PKTable: " ); ++ } ++ else ++ { ++ txt.sprintf( " PKTable: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " PKTable Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " PKTable Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( fk_cat, "" ) == 0 ) ++ { ++ fk_cat = NULL; ++ pOdbcTest->out_win->append( " FKCatalog: " ); ++ } ++ else if ( strcmp( fk_cat, "" ) == 0 ) ++ { ++ fk_cat = ""; ++ pOdbcTest->out_win->append( " FKCatalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " FKCatalog: %s", fk_cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( fk_lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ fk_cat_len = SQL_NTS; ++ txt.sprintf( " FKCatalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ fk_cat_len = atoi( fk_lcat ); ++ txt.sprintf( " FKCatalog Len: %d", fk_cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( fk_sch, "" ) == 0 ) ++ { ++ fk_sch = NULL; ++ pOdbcTest->out_win->append( " FKSchema: " ); ++ } ++ else if ( strcmp( fk_sch, "" ) == 0 ) ++ { ++ fk_sch = ""; ++ pOdbcTest->out_win->append( " FKSchema: " ); ++ } ++ else ++ { ++ txt.sprintf( " FKSchema: %s", fk_sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( fk_lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ fk_sch_len = SQL_NTS; ++ txt.sprintf( " FKSchema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ fk_sch_len = atoi( lsch ); ++ txt.sprintf( " FKSchema Len: %d", fk_sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( fk_tab, "" ) == 0 ) ++ { ++ fk_tab = NULL; ++ pOdbcTest->out_win->append( " FKTable: " ); ++ } ++ else if ( strcmp( fk_tab, "" ) == 0 ) ++ { ++ fk_tab = ""; ++ pOdbcTest->out_win->append( " FKTable: " ); ++ } ++ else ++ { ++ txt.sprintf( " FKTable: %s", fk_tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( fk_ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ fk_tab_len = SQL_NTS; ++ txt.sprintf( " FKTable Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ fk_tab_len = atoi( ltab ); ++ txt.sprintf( " FKTable Len: %d", fk_tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLForeignKeys( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ (SQLCHAR*)fk_cat, fk_cat_len, ++ (SQLCHAR*)fk_sch, fk_sch_len, ++ (SQLCHAR*)fk_tab, fk_tab_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dForeignKeys::dForeignKeys( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "PKCatalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "PKSchema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "PKTable:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ fk_catalog = new QComboBox( this ); ++ fk_catalog->setEditable( true ); ++ fk_catalog->setGeometry( 100, 140, 150, 20 ); ++ fk_l_catalog = new QLabel( "FKCatalog:", this ); ++ fk_l_catalog->setGeometry( 10, 140, 90, 20 ); ++ fk_catalog->insertItem( 0, "" ); ++ fk_catalog->insertItem( 1, "" ); ++ ++ fk_schema = new QComboBox( this ); ++ fk_schema->setEditable( true ); ++ fk_schema->setGeometry( 100, 170, 150, 20 ); ++ fk_l_schema = new QLabel( "FKSchema:", this ); ++ fk_l_schema->setGeometry( 10, 170, 90, 20 ); ++ fk_schema->insertItem( 0, "" ); ++ fk_schema->insertItem( 1, "" ); ++ ++ fk_table = new QComboBox( this ); ++ fk_table->setEditable( true ); ++ fk_table->setGeometry( 100, 200, 150, 20 ); ++ fk_l_table = new QLabel( "FKTable:", this ); ++ fk_l_table->setGeometry( 10, 200, 90, 20 ); ++ fk_table->insertItem( 0, "" ); ++ fk_table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 140, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 140, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ fk_catalog_len = new QComboBox( this ); ++ fk_catalog_len->setEditable( true ); ++ fk_catalog_len->setGeometry( 370, 140, 150, 20 ); ++ fk_l_catalog_len = new QLabel( "String Length:", this ); ++ fk_l_catalog_len->setGeometry( 280, 140, 90, 20 ); ++ fk_catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ fk_catalog_len->insertItem( 1, "0" ); ++ ++ fk_schema_len = new QComboBox( this ); ++ fk_schema_len->setEditable( true ); ++ fk_schema_len->setGeometry( 370, 170, 150, 20 ); ++ fk_l_schema_len = new QLabel( "String Length:", this ); ++ fk_l_schema_len->setGeometry( 280, 170, 90, 20 ); ++ fk_schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ fk_schema_len->insertItem( 1, "0" ); ++ ++ fk_table_len = new QComboBox( this ); ++ fk_table_len->setEditable( true ); ++ fk_table_len->setGeometry( 370, 200, 150, 20 ); ++ fk_l_table_len = new QLabel( "String Length:", this ); ++ fk_l_table_len->setGeometry( 280, 200, 90, 20 ); ++ fk_table_len->insertItem( 0, "SQL_NTS=-3" ); ++ fk_table_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dForeignKeys::~dForeignKeys() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete fk_catalog; ++ delete fk_schema; ++ delete fk_table; ++ delete fk_l_catalog; ++ delete fk_l_schema; ++ delete fk_l_table; ++ delete fk_catalog_len; ++ delete fk_schema_len; ++ delete fk_table_len; ++ delete fk_l_catalog_len; ++ delete fk_l_schema_len; ++ delete fk_l_table_len; ++} ++ ++void dPrimaryKeys::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *lcat, *lsch, *ltab; ++ QString qcat, qsch, qtab; ++ QString qlcat, qlsch, qltab; ++ int cat_len, sch_len, tab_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLPrimaryKeys():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLPrimaryKeys( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dPrimaryKeys::dPrimaryKeys( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox(this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dPrimaryKeys::~dPrimaryKeys() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++} ++ ++void dProcedures::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *lcat, *lsch, *ltab; ++ QString qcat, qsch, qtab; ++ QString qlcat, qlsch, qltab; ++ int cat_len, sch_len, tab_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLProcedures():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Procedure: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Procedure: " ); ++ } ++ else ++ { ++ txt.sprintf( " Procedure: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Procedure Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Procedure Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLProcedures( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dProcedures::dProcedures( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Procedure:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dProcedures::~dProcedures() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++} ++ ++void dProcedureColumns::Ok() ++{ ++ const char *cat, *sch, *tab, *col; ++ const char *lcat, *lsch, *ltab, *lcol; ++ QString qcat, qsch, qtab, qcol; ++ QString qlcat, qlsch, qltab, qlcol; ++ int cat_len, sch_len, tab_len, col_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qcol = column ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ qlcol = column_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ col = qcol.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ lcol = qlcol.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLProcedureColumns():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Procedure: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Procedure: " ); ++ } ++ else ++ { ++ txt.sprintf( " Procedure: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( col, "" ) == 0 ) ++ { ++ col = NULL; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else if ( strcmp( col, "" ) == 0 ) ++ { ++ col = ""; ++ pOdbcTest->out_win->append( " Column: " ); ++ } ++ else ++ { ++ txt.sprintf( " Column: %s", col ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcol, "SQL_NTS", 7 ) == 0 ) ++ { ++ col_len = SQL_NTS; ++ txt.sprintf( " Column Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ col_len = atoi( lcol ); ++ txt.sprintf( " Column Len: %d", col_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLProcedureColumns( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ (SQLCHAR*)col, col_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dProcedureColumns::dProcedureColumns( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Procedure:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ column = new QComboBox( this ); ++ column->setEditable( true ); ++ column->setGeometry( 100, 140, 150, 20 ); ++ l_column = new QLabel( "Column:", this ); ++ l_column->setGeometry( 10, 140, 90, 20 ); ++ column->insertItem( 0, "" ); ++ column->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ column_len = new QComboBox( this ); ++ column_len->setEditable( true ); ++ column_len->setGeometry( 370, 140, 150, 20 ); ++ l_column_len = new QLabel( "String Length:", this ); ++ l_column_len->setGeometry( 280, 140, 90, 20 ); ++ column_len->insertItem( 0, "SQL_NTS=-3" ); ++ column_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dProcedureColumns::~dProcedureColumns() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete column; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete l_column; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete column_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete l_column_len; ++} ++ ++void dTablePrivileges::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *lcat, *lsch, *ltab; ++ QString qcat, qsch, qtab; ++ QString qlcat, qlsch, qltab; ++ int cat_len, sch_len, tab_len; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len ->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLTablePrivileges():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLTablePrivileges( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dTablePrivileges::dTablePrivileges( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dTablePrivileges::~dTablePrivileges() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++} ++ ++void dGetTypeInfo::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ int index; ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLINTEGER info_type; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetTypeInfo():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = type->currentIndex(); ++ ++ info_type = get_type_options[ index ].attr; ++ txt.sprintf( " Data Type: %s=%d (%s)", get_type_options[ index ].text, ++ get_type_options[ index ].attr, get_type_options[ index ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLGetTypeInfo( in_handle, info_type ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dGetTypeInfo::dGetTypeInfo( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ type = new QComboBox( this ); ++ type->setGeometry( 130, 80, 340, 20 ); ++ ++ pOdbcTest->fill_list_box( get_type_options, type ); ++ ++ l_type = new QLabel( "Data Type:", this ); ++ l_type->setGeometry( 10, 80, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dGetTypeInfo::~dGetTypeInfo() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete type; ++ delete l_type; ++} ++ ++void dStatistics::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *lcat, *lsch, *ltab; ++ QString qcat, qsch, qtab; ++ QString qlcat, qlsch, qltab; ++ int cat_len, sch_len, tab_len; ++ int res, res_val, uniq, uniq_val; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog ->currentText(); ++ qsch = schema ->currentText(); ++ qtab = table ->currentText(); ++ qlcat = catalog_len ->currentText(); ++ qlsch = schema_len ->currentText(); ++ qltab = table_len->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLStatistics():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ uniq = unique->currentIndex(); ++ ++ uniq_val = unique_options[ uniq ].attr; ++ txt.sprintf( " Unique: %s=%d (%s)", unique_options[ uniq ].text, ++ unique_options[ uniq ].attr, unique_options[ uniq ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ res = reserved->currentIndex(); ++ ++ res_val = reserved_options[ res ].attr; ++ txt.sprintf( " Reserved: %s=%d (%s)", reserved_options[ res ].text, ++ reserved_options[ res ].attr, reserved_options[ res ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLStatistics( in_handle, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ uniq_val, ++ res_val ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dStatistics::dStatistics( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 50, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 50, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 80, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 80, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 110, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 110, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 50, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 50, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 80, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 80, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 110, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 110, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ unique = new QComboBox( this ); ++ unique->setGeometry( 100, 140, 200, 20 ); ++ pOdbcTest->fill_list_box( unique_options, unique ); ++ l_unique = new QLabel( "Unique:", this ); ++ l_unique->setGeometry( 10, 140, 90, 20 ); ++ ++ reserved = new QComboBox( this ); ++ reserved->setGeometry( 100, 170, 200, 20 ); ++ pOdbcTest->fill_list_box( reserved_options, reserved ); ++ l_reserved = new QLabel( "Reserved:", this ); ++ l_reserved->setGeometry( 10, 170, 90, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dStatistics::~dStatistics() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete unique; ++ delete reserved; ++ delete l_unique; ++ delete l_reserved; ++} ++ ++void dSpecialColumns::Ok() ++{ ++ const char *cat, *sch, *tab; ++ const char *lcat, *lsch, *ltab; ++ QString qcat, qsch, qtab; ++ QString qlcat, qlsch, qltab; ++ int cat_len, sch_len, tab_len; ++ int nul, nul_val, scp, scp_val; ++ int id, id_val; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qcat = catalog->currentText(); ++ qsch = schema->currentText(); ++ qtab = table->currentText(); ++ ++ qlcat = catalog_len->currentText(); ++ qlsch = schema_len->currentText(); ++ qltab = table_len->currentText(); ++ ++ cat = qcat.toUtf8().constData(); ++ sch = qsch.toUtf8().constData(); ++ tab = qtab.toUtf8().constData(); ++ ++ lcat = qlcat.toUtf8().constData(); ++ lsch = qlsch.toUtf8().constData(); ++ ltab = qltab.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLSpecialColumns():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ id = ident->currentIndex(); ++ ++ id_val = ident_options[ id ].attr; ++ txt.sprintf( " Identifier Type: %s=%d (%s)", ident_options[ id ].text, ++ ident_options[ id ].attr, ident_options[ id ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = NULL; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else if ( strcmp( cat, "" ) == 0 ) ++ { ++ cat = ""; ++ pOdbcTest->out_win->append( " Catalog: " ); ++ } ++ else ++ { ++ txt.sprintf( " Catalog: %s", cat ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lcat, "SQL_NTS", 7 ) == 0 ) ++ { ++ cat_len = SQL_NTS; ++ txt.sprintf( " Catalog Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ cat_len = atoi( lcat ); ++ txt.sprintf( " Catalog Len: %d", cat_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = NULL; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else if ( strcmp( sch, "" ) == 0 ) ++ { ++ sch = ""; ++ pOdbcTest->out_win->append( " Schema: " ); ++ } ++ else ++ { ++ txt.sprintf( " Schema: %s", sch ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( lsch, "SQL_NTS", 7 ) == 0 ) ++ { ++ sch_len = SQL_NTS; ++ txt.sprintf( " Schema Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ sch_len = atoi( lsch ); ++ txt.sprintf( " Schema Len: %d", sch_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = NULL; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else if ( strcmp( tab, "" ) == 0 ) ++ { ++ tab = ""; ++ pOdbcTest->out_win->append( " Table: " ); ++ } ++ else ++ { ++ txt.sprintf( " Table: %s", tab ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( ltab, "SQL_NTS", 7 ) == 0 ) ++ { ++ tab_len = SQL_NTS; ++ txt.sprintf( " Table Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ tab_len = atoi( ltab ); ++ txt.sprintf( " Table Len: %d", tab_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ scp = scope->currentIndex(); ++ ++ scp_val = unique_options[ scp ].attr; ++ txt.sprintf( " Scope: %s=%d (%s)", scope_options[ scp ].text, ++ scope_options[ scp ].attr, scope_options[ scp ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ nul = nullable->currentIndex(); ++ ++ nul_val = null_options[ nul ].attr; ++ txt.sprintf( " Nullable: %s=%d (%s)", null_options[ nul ].text, ++ null_options[ nul ].attr, null_options[ nul ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSpecialColumns( in_handle, ++ id_val, ++ (SQLCHAR*)cat, cat_len, ++ (SQLCHAR*)sch, sch_len, ++ (SQLCHAR*)tab, tab_len, ++ scp_val, ++ nul_val ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSpecialColumns::dSpecialColumns( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ ident = new QComboBox( this ); ++ ident->setGeometry( 100, 50, 250, 20 ); ++ pOdbcTest->fill_list_box( ident_options, ident ); ++ l_ident = new QLabel( "Identifier Type:", this ); ++ l_ident->setGeometry( 10, 50, 90, 20 ); ++ ++ catalog = new QComboBox( this ); ++ catalog->setEditable( true ); ++ catalog->setGeometry( 100, 80, 150, 20 ); ++ l_catalog = new QLabel( "Catalog:", this ); ++ l_catalog->setGeometry( 10, 80, 90, 20 ); ++ catalog->insertItem( 0, "" ); ++ catalog->insertItem( 1, "" ); ++ ++ schema = new QComboBox( this ); ++ schema->setEditable( true ); ++ schema->setGeometry( 100, 110, 150, 20 ); ++ l_schema = new QLabel( "Schema:", this ); ++ l_schema->setGeometry( 10, 110, 90, 20 ); ++ schema->insertItem( 0, "" ); ++ schema->insertItem( 1, "" ); ++ ++ table = new QComboBox( this ); ++ table->setEditable( true ); ++ table->setGeometry( 100, 140, 150, 20 ); ++ l_table = new QLabel( "Table:", this ); ++ l_table->setGeometry( 10, 140, 90, 20 ); ++ table->insertItem( 0, "" ); ++ table->insertItem( 1, "" ); ++ ++ catalog_len = new QComboBox( this ); ++ catalog_len->setEditable( true ); ++ catalog_len->setGeometry( 370, 80, 150, 20 ); ++ l_catalog_len = new QLabel( "String Length:", this ); ++ l_catalog_len->setGeometry( 280, 80, 90, 20 ); ++ catalog_len->insertItem( 0, "SQL_NTS=-3" ); ++ catalog_len->insertItem( 1, "0" ); ++ ++ schema_len = new QComboBox( this ); ++ schema_len->setEditable( true ); ++ schema_len->setGeometry( 370, 110, 150, 20 ); ++ l_schema_len = new QLabel( "String Length:", this ); ++ l_schema_len->setGeometry( 280, 110, 90, 20 ); ++ schema_len->insertItem( 0, "SQL_NTS=-3" ); ++ schema_len->insertItem( 1, "0" ); ++ ++ table_len = new QComboBox( this ); ++ table_len->setEditable( true ); ++ table_len->setGeometry( 370, 140, 150, 20 ); ++ l_table_len = new QLabel( "String Length:", this ); ++ l_table_len->setGeometry( 280, 140, 90, 20 ); ++ table_len->insertItem( 0, "SQL_NTS=-3" ); ++ table_len->insertItem( 1, "0" ); ++ ++ scope = new QComboBox( this ); ++ scope->setGeometry( 100, 170, 250, 20 ); ++ pOdbcTest->fill_list_box( scope_options, scope ); ++ l_scope = new QLabel( "Scope:", this ); ++ l_scope->setGeometry( 10, 170, 90, 20 ); ++ ++ nullable = new QComboBox( this ); ++ nullable->setGeometry( 100, 200, 250, 20 ); ++ pOdbcTest->fill_list_box( null_options, nullable ); ++ l_nullable = new QLabel( "Reserved:", this ); ++ l_nullable->setGeometry( 10, 200, 90, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dSpecialColumns::~dSpecialColumns() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete catalog; ++ delete schema; ++ delete table; ++ delete l_handle; ++ delete l_catalog; ++ delete l_schema; ++ delete l_table; ++ delete catalog_len; ++ delete schema_len; ++ delete table_len; ++ delete l_catalog_len; ++ delete l_schema_len; ++ delete l_table_len; ++ delete scope; ++ delete nullable; ++ delete l_scope; ++ delete l_nullable; ++ delete ident; ++ delete l_ident; ++} ++ ++void OdbcTest::slotColumns() ++{ ++ dColumns *dlg = new dColumns( this, "SQLColumns" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotColumnPrivileges() ++{ ++ dColumnPrivileges *dlg = new dColumnPrivileges( this, "SQLColumnPrivileges" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetTypeInfo() ++{ ++ dGetTypeInfo *dlg = new dGetTypeInfo( this, "SQLGetTypeInfo" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotForeignKeys() ++{ ++ dForeignKeys *dlg = new dForeignKeys( this, "SQLForeignKeys" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotPrimaryKeys() ++{ ++ dPrimaryKeys *dlg = new dPrimaryKeys( this, "SQLPrimaryKeys" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotProcedures() ++{ ++ dProcedures *dlg = new dProcedures( this, "SQLProcedures" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotProcedureColumns() ++{ ++ dProcedureColumns *dlg = new dProcedureColumns( this, "SQLProcedureColumns" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSpecialColumns() ++{ ++ dSpecialColumns *dlg = new dSpecialColumns( this, "SQLSpecialColumns" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotStatistics() ++{ ++ dStatistics *dlg = new dStatistics( this, "SQLStatistics" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotTables() ++{ ++ dTables *dlg = new dTables( this, "SQLTables" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotTablePrivileges() ++{ ++ dTablePrivileges *dlg = new dTablePrivileges( this, "SQLTablePrivileges" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} +diff --git a/unixODBC-2.3.7/tests/catalog.h b/unixODBC-2.3.7/tests/catalog.h +new file mode 100644 +index 0000000..71efb19 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/catalog.h +@@ -0,0 +1,293 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dTables : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dTables( OdbcTest *pOdbcTest, QString name ); ++ ~dTables(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table, *type; ++ QComboBox *schema_len, *catalog_len, *table_len, *type_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table, *l_type; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len, *l_type_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dColumns : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dColumns( OdbcTest *pOdbcTest, QString name ); ++ ~dColumns(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table, *column; ++ QComboBox *schema_len, *catalog_len, *table_len, *column_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table, *l_column; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len, *l_column_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dColumnPrivileges : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dColumnPrivileges( OdbcTest *pOdbcTest, QString name ); ++ ~dColumnPrivileges(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table, *column; ++ QComboBox *schema_len, *catalog_len, *table_len, *column_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table, *l_column; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len, *l_column_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dForeignKeys : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dForeignKeys( OdbcTest *pOdbcTest, QString name ); ++ ~dForeignKeys(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *fk_schema, *fk_catalog, *fk_table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QComboBox *fk_schema_len, *fk_catalog_len, *fk_table_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *fk_l_schema, *fk_l_catalog, *fk_l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QLabel *fk_l_schema_len, *fk_l_catalog_len, *fk_l_table_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dPrimaryKeys : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dPrimaryKeys( OdbcTest *pOdbcTest, QString name ); ++ ~dPrimaryKeys(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dProcedures : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dProcedures( OdbcTest *pOdbcTest, QString name ); ++ ~dProcedures(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dProcedureColumns : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dProcedureColumns( OdbcTest *pOdbcTest, QString name ); ++ ~dProcedureColumns(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table, *column; ++ QComboBox *schema_len, *catalog_len, *table_len, *column_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table, *l_column; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len, *l_column_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dTablePrivileges : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dTablePrivileges( OdbcTest *pOdbcTest, QString name ); ++ ~dTablePrivileges(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dGetTypeInfo : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetTypeInfo( OdbcTest *pOdbcTest, QString name ); ++ ~dGetTypeInfo(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *type; ++ QLabel *l_handle, *l_type; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dStatistics : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dStatistics( OdbcTest *pOdbcTest, QString name ); ++ ~dStatistics(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QComboBox *unique, *reserved; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QLabel *l_unique, *l_reserved; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dSpecialColumns : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSpecialColumns( OdbcTest *pOdbcTest, QString name ); ++ ~dSpecialColumns(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *schema, *catalog, *table; ++ QComboBox *schema_len, *catalog_len, *table_len; ++ QComboBox *ident, *scope, *nullable; ++ QLabel *l_handle, *l_schema, *l_catalog, *l_table; ++ QLabel *l_schema_len, *l_catalog_len, *l_table_len; ++ QLabel *l_ident, *l_scope, *l_nullable; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ +diff --git a/unixODBC-2.3.7/tests/conn.cpp b/unixODBC-2.3.7/tests/conn.cpp +new file mode 100644 +index 0000000..049d8f1 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/conn.cpp +@@ -0,0 +1,4460 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "conn.h" ++#include "DlgDbcConnect.h" ++#include "OdbcTest.h" ++ ++static attr_options gf_options[] = ++{ ++ { "SQL_API_ODBC3_ALL_FUNCTIONS", SQL_API_ODBC3_ALL_FUNCTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_API_ALL_FUNCTIONS", SQL_API_ALL_FUNCTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLALLOCCONNECT", SQL_API_SQLALLOCCONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLALLOCENV", SQL_API_SQLALLOCENV, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLALLOCHANDLESTD", SQL_API_SQLALLOCHANDLESTD, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLALLOCSTMT", SQL_API_SQLALLOCSTMT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLBINDCOL", SQL_API_SQLBINDCOL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLBINDPARAMETER", SQL_API_SQLBINDPARAMETER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLBROWSECONNECT", SQL_API_SQLBROWSECONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLBULKOPERATIONS", SQL_API_SQLBULKOPERATIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCANCEL", SQL_API_SQLCANCEL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCOLATTRIBUTE", SQL_API_SQLCOLATTRIBUTE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCOLATTRIBUTES", SQL_API_SQLCOLATTRIBUTES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCOLUMNPRIVILEGES", SQL_API_SQLCOLUMNPRIVILEGES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCOLUMNS", SQL_API_SQLCOLUMNS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCONNECT", SQL_API_SQLCONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDATASOURCES", SQL_API_SQLDATASOURCES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDESCRIBECOL", SQL_API_SQLDESCRIBECOL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDESCRIBEPARAM", SQL_API_SQLDESCRIBEPARAM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDISCONNECT", SQL_API_SQLDISCONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDRIVERCONNECT", SQL_API_SQLDRIVERCONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLDRIVERS", SQL_API_SQLDRIVERS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLERROR", SQL_API_SQLERROR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLEXECDIRECT", SQL_API_SQLEXECDIRECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLEXECUTE", SQL_API_SQLEXECUTE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLEXTENDEDFETCH", SQL_API_SQLEXTENDEDFETCH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFETCH", SQL_API_SQLFETCH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFOREIGNKEYS", SQL_API_SQLFOREIGNKEYS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFREECONNECT", SQL_API_SQLFREECONNECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFREEENV", SQL_API_SQLFREEENV, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFREESTMT", SQL_API_SQLFREESTMT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETCONNECTOPTION", SQL_API_SQLGETCONNECTOPTION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETCURSORNAME", SQL_API_SQLGETCURSORNAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETDATA", SQL_API_SQLGETDATA, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETFUNCTIONS", SQL_API_SQLGETFUNCTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETINFO", SQL_API_SQLGETINFO, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETSTMTOPTION", SQL_API_SQLGETSTMTOPTION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETTYPEINFO", SQL_API_SQLGETTYPEINFO, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLMORERESULTS", SQL_API_SQLMORERESULTS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLNATIVESQL", SQL_API_SQLNATIVESQL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLNUMPARAMS", SQL_API_SQLNUMPARAMS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLNUMRESULTCOLS", SQL_API_SQLNUMRESULTCOLS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPARAMDATA", SQL_API_SQLPARAMDATA, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPARAMOPTIONS", SQL_API_SQLPARAMOPTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPREPARE", SQL_API_SQLPREPARE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPRIMARYKEYS", SQL_API_SQLPRIMARYKEYS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPROCEDURECOLUMNS", SQL_API_SQLPROCEDURECOLUMNS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPROCEDURES", SQL_API_SQLPROCEDURES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLPUTDATA", SQL_API_SQLPUTDATA, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLROWCOUNT", SQL_API_SQLROWCOUNT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETCONNECTOPTION", SQL_API_SQLSETCONNECTOPTION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETCURSORNAME", SQL_API_SQLSETCURSORNAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETPARAM", SQL_API_SQLSETPARAM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETPOS", SQL_API_SQLSETPOS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETSCROLLOPTIONS", SQL_API_SQLSETSCROLLOPTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETSTMTOPTION", SQL_API_SQLSETSTMTOPTION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSPECIALCOLUMNS", SQL_API_SQLSPECIALCOLUMNS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSTATISTICS", SQL_API_SQLSTATISTICS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLTABLEPRIVILEGES", SQL_API_SQLTABLEPRIVILEGES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLTABLES", SQL_API_SQLTABLES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLTRANSACT", SQL_API_SQLTRANSACT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLALLOCHANDLE", SQL_API_SQLALLOCHANDLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLBINDPARAM", SQL_API_SQLBINDPARAM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCLOSECURSOR", SQL_API_SQLCLOSECURSOR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLCOPYDESC", SQL_API_SQLCOPYDESC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLENDTRAN", SQL_API_SQLENDTRAN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFETCHSCROLL", SQL_API_SQLFETCHSCROLL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLFREEHANDLE", SQL_API_SQLFREEHANDLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETCONNECTATTR", SQL_API_SQLGETCONNECTATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETDESCFIELD", SQL_API_SQLGETDESCFIELD, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETDESCREC", SQL_API_SQLGETDESCREC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETDIAGFIELD", SQL_API_SQLGETDIAGFIELD, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETDIAGREC", SQL_API_SQLGETDIAGREC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETENVATTR", SQL_API_SQLGETENVATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLGETSTMTATTR", SQL_API_SQLGETSTMTATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETCONNECTATTR", SQL_API_SQLSETCONNECTATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETDESCFIELD", SQL_API_SQLSETDESCFIELD, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETDESCREC", SQL_API_SQLSETDESCREC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETENVATTR", SQL_API_SQLSETENVATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ {"SQL_API_SQLSETSTMTATTR", SQL_API_SQLSETSTMTATTR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options dc_options[] = ++{ ++ { "SQL_DRIVER_COMPLETE", SQL_DRIVER_COMPLETE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_NOPROMPT", SQL_DRIVER_NOPROMPT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_COMPLETE", SQL_DRIVER_COMPLETE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_COMPLETE_REQUIRED", SQL_DRIVER_COMPLETE_REQUIRED, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++static attr_options info_options[] = ++{ ++ { "SQL_ACCESSIBLE_PROCEDURES", SQL_ACCESSIBLE_PROCEDURES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ACCESSIBLE_TABLES", SQL_ACCESSIBLE_TABLES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ACTIVE_ENVIRONMENTS", SQL_ACTIVE_ENVIRONMENTS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_AGGREGATE_FUNCTIONS", SQL_AGGREGATE_FUNCTIONS, ++ { ++ { "SQL_AF_ALL", SQL_AF_ALL, NULL, 0}, ++ { "SQL_AF_AVG", SQL_AF_AVG, NULL, 0}, ++ { "SQL_AF_COUNT", SQL_AF_COUNT, NULL, 0}, ++ { "SQL_AF_DISTINCT", SQL_AF_DISTINCT,NULL, 0}, ++ { "SQL_AF_MAX", SQL_AF_MAX, NULL, 0}, ++ { "SQL_AF_MIN", SQL_AF_MIN, NULL, 0}, ++ { "SQL_AF_SUM", SQL_AF_SUM, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_ALTER_DOMAIN", SQL_ALTER_DOMAIN, ++ { ++ { "SQL_AD_ADD_DOMAIN_CONSTRAINT", SQL_AD_ADD_DOMAIN_CONSTRAINT, NULL, 0}, ++ { "SQL_AD_ADD_DOMAIN_DEFAULT", SQL_AD_ADD_DOMAIN_DEFAULT, NULL, 0}, ++ { "SQL_AD_CONSTRAINT_NAME_DEFINITION", SQL_AD_CONSTRAINT_NAME_DEFINITION, NULL, 0}, ++ { "SQL_AD_DROP_DOMAIN_CONSTRAINT", SQL_AD_DROP_DOMAIN_CONSTRAINT, NULL, 0}, ++ { "SQL_AD_DROP_DOMAIN_DEFAULT", SQL_AD_DROP_DOMAIN_DEFAULT, NULL, 0}, ++ { "SQL_AD_ADD_CONSTRAINT_DEFERRABLE", SQL_AD_ADD_CONSTRAINT_DEFERRABLE, NULL, 0}, ++ { "SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE", SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE, NULL, 0}, ++ { "SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED", SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED, NULL, 0}, ++ { "SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE", SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_ALTER_TABLE", SQL_ALTER_TABLE, ++ { ++ { "SQL_AT_ADD_COLUMN_COLLATION", SQL_AT_ADD_COLUMN_COLLATION, NULL, 0}, ++ { "SQL_AT_ADD_COLUMN_DEFAULT", SQL_AT_ADD_COLUMN_DEFAULT, NULL, 0}, ++ { "SQL_AT_ADD_COLUMN_SINGLE", SQL_AT_ADD_COLUMN_SINGLE, NULL, 0}, ++ { "SQL_AT_ADD_CONSTRAINT", SQL_AT_ADD_CONSTRAINT, NULL, 0}, ++ { "SQL_AT_ADD_TABLE_CONSTRAINT", SQL_AT_ADD_TABLE_CONSTRAINT, NULL, 0}, ++ { "SQL_AT_CONSTRAINT_NAME_DEFINITION", SQL_AT_CONSTRAINT_NAME_DEFINITION, NULL, 0}, ++ { "SQL_AT_DROP_COLUMN_CASCADE", SQL_AT_DROP_COLUMN_CASCADE, NULL, 0}, ++ { "SQL_AT_DROP_COLUMN_DEFAULT", SQL_AT_DROP_COLUMN_DEFAULT, NULL, 0}, ++ { "SQL_AT_DROP_COLUMN_RESTRICT", SQL_AT_DROP_COLUMN_RESTRICT, NULL, 0}, ++ { "SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE", SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE, NULL, 0}, ++ { "SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT", SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT, NULL, 0}, ++ { "SQL_AT_SET_COLUMN_DEFAULT", SQL_AT_SET_COLUMN_DEFAULT, NULL, 0}, ++ { "SQL_AT_CONSTRAINT_INITIALLY_DEFERRED", SQL_AT_CONSTRAINT_INITIALLY_DEFERRED, NULL, 0}, ++ { "SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE", SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE, NULL, 0}, ++ { "SQL_AT_CONSTRAINT_DEFERRABLE", SQL_AT_CONSTRAINT_DEFERRABLE, NULL, 0}, ++ { "SQL_AT_CONSTRAINT_NON_DEFERRABLE", SQL_AT_CONSTRAINT_NON_DEFERRABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_ASYNC_MODE", SQL_ASYNC_MODE, ++ { ++ { "SQL_AM_CONNECTION", SQL_AM_CONNECTION, NULL, 0}, ++ { "SQL_AM_STATEMENT", SQL_AM_STATEMENT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BATCH_ROW_COUNT", SQL_BATCH_ROW_COUNT, ++ { ++ { "SQL_BRC_ROLLED_UP", SQL_BRC_ROLLED_UP, NULL, 0}, ++ { "SQL_BRC_PROCEDURES", SQL_BRC_PROCEDURES, NULL, 0}, ++ { "SQL_BRC_EXPLICIT", SQL_BRC_EXPLICIT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_BATCH_SUPPORT", SQL_BATCH_SUPPORT, ++ { ++ { "SQL_BS_SELECT_EXPLI|CIT", SQL_BS_SELECT_EXPLICIT, NULL, 0}, ++ { "SQL_BS_ROW_COUNT_EXPLICIT", SQL_BS_ROW_COUNT_EXPLICIT, NULL, 0}, ++ { "SQL_BS_SELECT_PROC", SQL_BS_SELECT_PROC, NULL, 0}, ++ { "SQL_BS_ROW_COUNT_PROC", SQL_BS_ROW_COUNT_PROC, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_BOOKMARK_PERSISTENCE", SQL_BOOKMARK_PERSISTENCE, ++ { ++ { "SQL_BP_CLOSE", SQL_BP_CLOSE, NULL, 0}, ++ { "SQL_BP_DELETE", SQL_BP_DELETE, NULL, 0}, ++ { "SQL_BP_DROP", SQL_BP_DROP, NULL, 0}, ++ { "SQL_BP_TRANSACTION", SQL_BP_TRANSACTION, NULL, 0}, ++ { "SQL_BP_UPDATE", SQL_BP_UPDATE, NULL, 0}, ++ { "SQL_BP_OTHER_HSTMT", SQL_BP_OTHER_HSTMT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CATALOG_LOCATION", SQL_CATALOG_LOCATION, ++ { ++ { "SQL_CL_START", SQL_CL_START, NULL, 0}, ++ { "SQL_CL_END", SQL_CL_END, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CATALOG_NAME", SQL_CATALOG_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_CATALOG_NAME_SEPARATOR", SQL_CATALOG_NAME_SEPARATOR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_CATALOG_TERM", SQL_CATALOG_TERM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_CATALOG_USAGE", SQL_CATALOG_USAGE, ++ { ++ { "SQL_CU_DML_STATEMENTS", SQL_CU_DML_STATEMENTS, NULL, 0}, ++ { "SQL_CU_PROCEDURE_INVOCATION", SQL_CU_PROCEDURE_INVOCATION, NULL, 0}, ++ { "SQL_CU_TABLE_DEFINITION", SQL_CU_TABLE_DEFINITION, NULL, 0}, ++ { "SQL_CU_INDEX_DEFINITION", SQL_CU_INDEX_DEFINITION, NULL, 0}, ++ { "SQL_CU_PRIVILEGE_DEFINITION", SQL_CU_PRIVILEGE_DEFINITION, NULL, 0}, ++ { "SQL_CL_END", SQL_CL_END, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_COLLATION_SEQ", SQL_COLLATION_SEQ, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_ALIAS", SQL_COLUMN_ALIAS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_ODBC_API_CONFORMANCE", SQL_ODBC_API_CONFORMANCE, ++ { ++ { "SQL_OAC_NONE", SQL_OAC_NONE, NULL, 0}, ++ { "SQL_OAC_LEVEL1", SQL_OAC_LEVEL1, NULL, 0}, ++ { "SQL_OAC_LEVEL2", SQL_OAC_LEVEL2, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ODBC_SAG_CLI_CONFORMANCE", SQL_ODBC_SAG_CLI_CONFORMANCE, ++ { ++ { "SQL_OSCC_NOT_COMPLIANT", SQL_OSCC_NOT_COMPLIANT, NULL, 0}, ++ { "SQL_OSCC_COMPLIANT", SQL_OSCC_COMPLIANT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ODBC_SQL_CONFORMANCE", SQL_ODBC_SQL_CONFORMANCE, ++ { ++ { "SQL_OSC_MINIMUM", SQL_OSC_MINIMUM, NULL, 0}, ++ { "SQL_OSC_CORE", SQL_OSC_CORE, NULL, 0}, ++ { "SQL_OSC_EXTENDED", SQL_OSC_EXTENDED, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_CONCAT_NULL_BEHAVIOR", SQL_CONCAT_NULL_BEHAVIOR, ++ { ++ { "SQL_CB_NULL", SQL_CB_NULL, NULL, 0}, ++ { "SQL_CB_NON_NULL", SQL_CB_NON_NULL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_CONVERT_BIGINT", SQL_CONVERT_BIGINT, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_BINARY", SQL_CONVERT_BINARY, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_BIT", SQL_CONVERT_BIT, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_CHAR", SQL_CONVERT_CHAR, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_DATE", SQL_CONVERT_DATE, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_DECIMAL", SQL_CONVERT_DECIMAL, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_DOUBLE", SQL_CONVERT_DOUBLE, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_FLOAT", SQL_CONVERT_FLOAT, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_INTEGER", SQL_CONVERT_INTEGER, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_INTERVAL_YEAR_MONTH", SQL_CONVERT_INTERVAL_YEAR_MONTH, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_INTERVAL_DAY_TIME", SQL_CONVERT_INTERVAL_DAY_TIME, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_LONGVARBINARY", SQL_CONVERT_LONGVARBINARY, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_LONGVARCHAR", SQL_CONVERT_LONGVARCHAR, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_NUMERIC", SQL_CONVERT_NUMERIC, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_REAL", SQL_CONVERT_REAL, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_SMALLINT", SQL_CONVERT_SMALLINT, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_TIME", SQL_CONVERT_TIME, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_TIMESTAMP", SQL_CONVERT_TIMESTAMP, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_TINYINT", SQL_CONVERT_TINYINT, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_VARBINARY", SQL_CONVERT_VARBINARY, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_VARCHAR", SQL_CONVERT_VARCHAR, ++ { ++ { "SQL_CVT_BIGINT", SQL_CVT_BIGINT, NULL, 0}, ++ { "SQL_CVT_BINARY", SQL_CVT_BINARY, NULL, 0}, ++ { "SQL_CVT_BIT", SQL_CVT_BIT, NULL, 0}, ++ { "SQL_CVT_CHAR", SQL_CVT_CHAR, NULL, 0}, ++ { "SQL_CVT_DATE", SQL_CVT_DATE, NULL, 0}, ++ { "SQL_CVT_DECIMAL", SQL_CVT_DECIMAL, NULL, 0}, ++ { "SQL_CVT_DOUBLE", SQL_CVT_DOUBLE, NULL, 0}, ++ { "SQL_CVT_FLOAT", SQL_CVT_FLOAT, NULL, 0}, ++ { "SQL_CVT_INTEGER", SQL_CVT_INTEGER, NULL, 0}, ++ { "SQL_CVT_INTERVAL_YEAR_MONTH", SQL_CVT_INTERVAL_YEAR_MONTH, NULL, 0}, ++ { "SQL_CVT_INTERVAL_DAY_TIME", SQL_CVT_INTERVAL_DAY_TIME, NULL, 0}, ++ { "SQL_CVT_LONGVARBINARY", SQL_CVT_LONGVARBINARY, NULL, 0}, ++ { "SQL_CVT_LONGVARCHAR", SQL_CVT_LONGVARCHAR, NULL, 0}, ++ { "SQL_CVT_NUMERIC", SQL_CVT_NUMERIC, NULL, 0}, ++ { "SQL_CVT_REAL", SQL_CVT_REAL, NULL, 0}, ++ { "SQL_CVT_SMALLINT", SQL_CVT_SMALLINT, NULL, 0}, ++ { "SQL_CVT_TIME", SQL_CVT_TIME, NULL, 0}, ++ { "SQL_CVT_TIMESTAMP", SQL_CVT_TIMESTAMP, NULL, 0}, ++ { "SQL_CVT_TINYINT", SQL_CVT_TINYINT, NULL, 0}, ++ { "SQL_CVT_VARBINARY", SQL_CVT_VARBINARY, NULL, 0}, ++ { "SQL_CVT_VARCHAR", SQL_CVT_VARCHAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CONVERT_FUNCTIONS", SQL_CONVERT_FUNCTIONS, ++ { ++ { "SQL_FN_CVT_CAST", SQL_FN_CVT_CAST, NULL, 0}, ++ { "SQL_FN_CVT_CONVERT", SQL_FN_CVT_CONVERT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CORRELATION_NAME", SQL_CORRELATION_NAME, ++ { ++ { "SQL_CN_NONE", SQL_CN_NONE, NULL, 0}, ++ { "SQL_CN_DIFFERENT", SQL_CN_DIFFERENT, NULL, 0}, ++ { "SQL_CN_ANY", SQL_CN_ANY, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_CREATE_ASSERTION", SQL_CREATE_ASSERTION, ++ { ++ { "SQL_CA_CREATE_ASSERTION", SQL_CA_CREATE_ASSERTION, NULL, 0}, ++ { "SQL_CA_CONSTRAINT_INITIALLY_DEFERRED", SQL_CA_CONSTRAINT_INITIALLY_DEFERRED, NULL, 0}, ++ { "SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE", SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE, NULL, 0}, ++ { "SQL_CA_CONSTRAINT_DEFERRABLE", SQL_CA_CONSTRAINT_DEFERRABLE, NULL, 0}, ++ { "SQL_CA_CONSTRAINT_NON_DEFERRABLE", SQL_CA_CONSTRAINT_NON_DEFERRABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_CHARACTER_SET", SQL_CREATE_CHARACTER_SET, ++ { ++ { "SQL_CCS_CREATE_CHARACTER_SET", SQL_CCS_CREATE_CHARACTER_SET, NULL, 0}, ++ { "SQL_CCS_COLLATE_CLAUSE", SQL_CCS_COLLATE_CLAUSE, NULL, 0}, ++ { "SQL_CCS_LIMITED_COLLATION", SQL_CCS_LIMITED_COLLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_COLLATION", SQL_CREATE_COLLATION, ++ { ++ { "SQL_CCOL_CREATE_COLLATION", SQL_CCOL_CREATE_COLLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_DOMAIN", SQL_CREATE_DOMAIN, ++ { ++ { "SQL_CDO_CREATE_DOMAIN", SQL_CDO_CREATE_DOMAIN, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT_NAME_DEFINITION", SQL_CDO_CONSTRAINT_NAME_DEFINITION, NULL, 0}, ++ { "SQL_CDO_DEFAULT", SQL_CDO_DEFAULT, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT", SQL_CDO_CONSTRAINT, NULL, 0}, ++ { "SQL_CDO_COLLATION", SQL_CDO_COLLATION, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED", SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE", SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT_DEFERRABLE", SQL_CDO_CONSTRAINT_DEFERRABLE, NULL, 0}, ++ { "SQL_CDO_CONSTRAINT_NON_DEFERRABLE", SQL_CDO_CONSTRAINT_NON_DEFERRABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_SCHEMA", SQL_CREATE_SCHEMA, ++ { ++ { "SQL_CS_CREATE_SCHEMA", SQL_CS_CREATE_SCHEMA, NULL, 0}, ++ { "SQL_CS_AUTHORIZATION", SQL_CS_AUTHORIZATION, NULL, 0}, ++ { "SQL_CS_DEFAULT_CHARACTER_SET", SQL_CS_DEFAULT_CHARACTER_SET, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_TABLE", SQL_CREATE_TABLE, ++ { ++ { "SQL_CT_CREATE_TABLE", SQL_CT_CREATE_TABLE, NULL, 0}, ++ { "SQL_CT_TABLE_CONSTRAINT", SQL_CT_TABLE_CONSTRAINT, NULL, 0}, ++ { "SQL_CT_CONSTRAINT_NAME_DEFINITION", SQL_CT_CONSTRAINT_NAME_DEFINITION, NULL, 0}, ++ { "SQL_CT_COMMIT_PRESERVE", SQL_CT_COMMIT_PRESERVE, NULL, 0}, ++ { "SQL_CT_COMMIT_DELETE", SQL_CT_COMMIT_DELETE, NULL, 0}, ++ { "SQL_CT_GLOBAL_TEMPORARY", SQL_CT_GLOBAL_TEMPORARY, NULL, 0}, ++ { "SQL_CT_LOCAL_TEMPORARY", SQL_CT_LOCAL_TEMPORARY, NULL, 0}, ++ { "SQL_CT_COLUMN_CONSTRAINT", SQL_CT_COLUMN_CONSTRAINT, NULL, 0}, ++ { "SQL_CT_COLUMN_DEFAULT", SQL_CT_COLUMN_DEFAULT, NULL, 0}, ++ { "SQL_CT_COLUMN_COLLATION", SQL_CT_COLUMN_COLLATION, NULL, 0}, ++ { "SQL_CT_CONSTRAINT_INITIALLY_DEFERRED", SQL_CT_CONSTRAINT_INITIALLY_DEFERRED, NULL, 0}, ++ { "SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE", SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE, NULL, 0}, ++ { "SQL_CT_CONSTRAINT_DEFERRABLE", SQL_CT_CONSTRAINT_DEFERRABLE, NULL, 0}, ++ { "SQL_CT_CONSTRAINT_NON_DEFERRABLE", SQL_CT_CONSTRAINT_NON_DEFERRABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_TRANSLATION", SQL_CREATE_TRANSLATION, ++ { ++ { "SQL_CTR_CREATE_TRANSLATION", SQL_CTR_CREATE_TRANSLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_CREATE_VIEW", SQL_CREATE_VIEW, ++ { ++ { "SQL_CV_CREATE_VIEW", SQL_CV_CREATE_VIEW, NULL, 0}, ++ { "SQL_CV_CHECK_OPTION", SQL_CV_CHECK_OPTION, NULL, 0}, ++ { "SQL_CV_CASCADED", SQL_CV_CASCADED, NULL, 0}, ++ { "SQL_CV_LOCAL", SQL_CV_LOCAL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, TRUE, 0 ++ }, ++ { "SQL_CURSOR_COMMIT_BEHAVIOR", SQL_CURSOR_COMMIT_BEHAVIOR, ++ { ++ { "SQL_CB_DELETE", SQL_CB_DELETE, NULL, 0}, ++ { "SQL_CB_CLOSE", SQL_CB_CLOSE, NULL, 0}, ++ { "SQL_CB_PRESERVE", SQL_CB_PRESERVE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_CURSOR_ROLLBACK_BEHAVIOR", SQL_CURSOR_ROLLBACK_BEHAVIOR, ++ { ++ { "SQL_CB_DELETE", SQL_CB_DELETE, NULL, 0}, ++ { "SQL_CB_CLOSE", SQL_CB_CLOSE, NULL, 0}, ++ { "SQL_CB_PRESERVE", SQL_CB_PRESERVE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_CURSOR_SENSITIVITY", SQL_CURSOR_SENSITIVITY, ++ { ++ { "SQL_INSENSITIVE", SQL_INSENSITIVE, NULL, 0}, ++ { "SQL_UNSPECIFIED", SQL_UNSPECIFIED, NULL, 0}, ++ { "SQL_SENSITIVE", SQL_SENSITIVE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DATA_SOURCE_NAME", SQL_DATA_SOURCE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DATA_SOURCE_READ_ONLY", SQL_DATA_SOURCE_READ_ONLY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DATABASE_NAME", SQL_DATABASE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DATETIME_LITERALS", SQL_DATETIME_LITERALS, ++ { ++ { "SQL_DL_SQL92_DATE", SQL_DL_SQL92_DATE, NULL, 0}, ++ { "SQL_DL_SQL92_TIME", SQL_DL_SQL92_TIME, NULL, 0}, ++ { "SQL_DL_SQL92_TIMESTAMP", SQL_DL_SQL92_TIMESTAMP, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_YEAR", SQL_DL_SQL92_INTERVAL_YEAR, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_MONTH", SQL_DL_SQL92_INTERVAL_MONTH, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_DAY", SQL_DL_SQL92_INTERVAL_DAY, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_HOUR", SQL_DL_SQL92_INTERVAL_HOUR, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_MINUTE", SQL_DL_SQL92_INTERVAL_MINUTE, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_SECOND", SQL_DL_SQL92_INTERVAL_SECOND, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH", SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR", SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE", SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND", SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE", SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND", SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND, NULL, 0}, ++ { "SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND", SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DBMS_NAME", SQL_DBMS_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DBMS_VER", SQL_DBMS_VER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DDL_INDEX", SQL_DDL_INDEX, ++ { ++ { "SQL_DI_CREATE_INDEX", SQL_DI_CREATE_INDEX, NULL, 0}, ++ { "SQL_DI_DROP_INDEX", SQL_DI_DROP_INDEX, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DEFAULT_TXN_ISOLATION", SQL_DEFAULT_TXN_ISOLATION, ++ { ++ { "SQL_TXN_READ_UNCOMMITTED", SQL_TXN_READ_UNCOMMITTED, NULL, 0}, ++ { "SQL_TXN_READ_COMMITTED", SQL_TXN_READ_COMMITTED, NULL, 0}, ++ { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ, NULL, 0}, ++ { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESCRIBE_PARAMETER", SQL_DESCRIBE_PARAMETER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DM_VER", SQL_DM_VER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DRIVER_HDBC", SQL_DRIVER_HDBC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_HENV", SQL_DRIVER_HENV, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_HDESC", SQL_DRIVER_HDESC, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_HLIB", SQL_DRIVER_HLIB, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_HSTMT", SQL_DRIVER_HSTMT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DRIVER_NAME", SQL_DRIVER_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DRIVER_ODBC_VER", SQL_DRIVER_ODBC_VER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DRIVER_VER", SQL_DRIVER_VER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DROP_ASSERTION", SQL_DROP_ASSERTION, ++ { ++ { "SQL_DA_DROP_ASSERTION", SQL_DA_DROP_ASSERTION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_CHARACTER_SET", SQL_DROP_CHARACTER_SET, ++ { ++ { "SQL_DCS_DROP_CHARACTER_SET", SQL_DCS_DROP_CHARACTER_SET, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_COLLATION", SQL_DROP_COLLATION, ++ { ++ { "SQL_DC_DROP_COLLATION", SQL_DC_DROP_COLLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_DOMAIN", SQL_DROP_DOMAIN, ++ { ++ { "SQL_DD_DROP_DOMAIN", SQL_DD_DROP_DOMAIN, NULL, 0}, ++ { "SQL_DD_CASCADE", SQL_DD_CASCADE, NULL, 0}, ++ { "SQL_DD_RESTRICT", SQL_DD_RESTRICT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_SCHEMA", SQL_DROP_SCHEMA, ++ { ++ { "SQL_DS_DROP_SCHEMA", SQL_DS_DROP_SCHEMA, NULL, 0}, ++ { "SQL_DS_CASCADE", SQL_DS_CASCADE, NULL, 0}, ++ { "SQL_DS_RESTRICT", SQL_DS_RESTRICT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_TABLE", SQL_DROP_TABLE, ++ { ++ { "SQL_DT_DROP_TABLE", SQL_DT_DROP_TABLE, NULL, 0}, ++ { "SQL_DT_CASCADE", SQL_DT_CASCADE, NULL, 0}, ++ { "SQL_DT_RESTRICT", SQL_DT_RESTRICT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_TRANSLATION", SQL_DROP_TRANSLATION, ++ { ++ { "SQL_DTR_DROP_TRANSLATION", SQL_DTR_DROP_TRANSLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DROP_VIEW", SQL_DROP_VIEW, ++ { ++ { "SQL_DV_DROP_VIEW", SQL_DV_DROP_VIEW, NULL, 0}, ++ { "SQL_DV_CASCADE", SQL_DV_CASCADE, NULL, 0}, ++ { "SQL_DV_RESTRICT", SQL_DV_RESTRICT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DYNAMIC_CURSOR_ATTRIBUTES1", SQL_DYNAMIC_CURSOR_ATTRIBUTES1, ++ { ++ { "SQL_CA1_NEXT", SQL_CA1_NEXT, NULL, 0}, ++ { "SQL_CA1_ABSOLUTE", SQL_CA1_ABSOLUTE, NULL, 0}, ++ { "SQL_CA1_RELATIVE", SQL_CA1_RELATIVE, NULL, 0}, ++ { "SQL_CA1_BOOKMARK", SQL_CA1_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_LOCK_EXCLUSIVE", SQL_CA1_LOCK_EXCLUSIVE, NULL, 0}, ++ { "SQL_CA1_LOCK_NO_CHANGE", SQL_CA1_LOCK_NO_CHANGE, NULL, 0}, ++ { "SQL_CA1_LOCK_UNLOCK", SQL_CA1_LOCK_UNLOCK, NULL, 0}, ++ { "SQL_CA1_POS_POSITION", SQL_CA1_POS_POSITION, NULL, 0}, ++ { "SQL_CA1_POS_UPDATE", SQL_CA1_POS_UPDATE, NULL, 0}, ++ { "SQL_CA1_POS_DELETE", SQL_CA1_POS_DELETE, NULL, 0}, ++ { "SQL_CA1_POS_REFRESH", SQL_CA1_POS_REFRESH, NULL, 0}, ++ { "SQL_CA1_POSITIONED_UPDATE", SQL_CA1_POSITIONED_UPDATE, NULL, 0}, ++ { "SQL_CA1_POSITIONED_DELETE", SQL_CA1_POSITIONED_DELETE, NULL, 0}, ++ { "SQL_CA1_SELECT_FOR_UPDATE", SQL_CA1_SELECT_FOR_UPDATE, NULL, 0}, ++ { "SQL_CA1_BULK_ADD", SQL_CA1_BULK_ADD, NULL, 0}, ++ { "SQL_CA1_BULK_UPDATE_BY_BOOKMARK", SQL_CA1_BULK_UPDATE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_DELETE_BY_BOOKMARK", SQL_CA1_BULK_DELETE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_FETCH_BY_BOOKMARK", SQL_CA1_BULK_FETCH_BY_BOOKMARK, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_DYNAMIC_CURSOR_ATTRIBUTES2", SQL_DYNAMIC_CURSOR_ATTRIBUTES2, ++ { ++ { "SQL_CA2_READ_ONLY_CONCURRENCY", SQL_CA2_READ_ONLY_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_LOCK_CONCURRENCY", SQL_CA2_LOCK_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_ROWVER_CONCURRENCY", SQL_CA2_OPT_ROWVER_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_VALUES_CONCURRENCY", SQL_CA2_OPT_VALUES_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_ADDITIONS", SQL_CA2_SENSITIVITY_ADDITIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_DELETIONS", SQL_CA2_SENSITIVITY_DELETIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_UPDATES", SQL_CA2_SENSITIVITY_UPDATES, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_SELECT", SQL_CA2_MAX_ROWS_SELECT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_INSERT", SQL_CA2_MAX_ROWS_INSERT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_DELETE", SQL_CA2_MAX_ROWS_DELETE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_UPDATE", SQL_CA2_MAX_ROWS_UPDATE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_CATALOG", SQL_CA2_MAX_ROWS_CATALOG, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_AFFECTS_ALL", SQL_CA2_MAX_ROWS_AFFECTS_ALL, NULL, 0}, ++ { "SQL_CA2_CRC_EXACT", SQL_CA2_CRC_EXACT, NULL, 0}, ++ { "SQL_CA2_CRC_APPROXIMATE", SQL_CA2_CRC_APPROXIMATE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_NON_UNIQUE", SQL_CA2_SIMULATE_NON_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_TRY_UNIQUE", SQL_CA2_SIMULATE_TRY_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_UNIQUE", SQL_CA2_SIMULATE_UNIQUE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_EXPRESSIONS_IN_ORDERBY", SQL_EXPRESSIONS_IN_ORDERBY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_FILE_USAGE", SQL_FILE_USAGE, ++ { ++ { "SQL_FILE_NOT_SUPPORTED", SQL_FILE_NOT_SUPPORTED, NULL, 0}, ++ { "SQL_FILE_TABLE", SQL_FILE_TABLE, NULL, 0}, ++ { "SQL_FILE_CATALOG", SQL_FILE_CATALOG, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1", SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, ++ { ++ { "SQL_CA1_NEXT", SQL_CA1_NEXT, NULL, 0}, ++ { "SQL_CA1_LOCK_EXCLUSIVE", SQL_CA1_LOCK_EXCLUSIVE, NULL, 0}, ++ { "SQL_CA1_LOCK_NO_CHANGE", SQL_CA1_LOCK_NO_CHANGE, NULL, 0}, ++ { "SQL_CA1_LOCK_UNLOCK", SQL_CA1_LOCK_UNLOCK, NULL, 0}, ++ { "SQL_CA1_POS_POSITION", SQL_CA1_POS_POSITION, NULL, 0}, ++ { "SQL_CA1_POS_UPDATE", SQL_CA1_POS_UPDATE, NULL, 0}, ++ { "SQL_CA1_POS_DELETE", SQL_CA1_POS_DELETE, NULL, 0}, ++ { "SQL_CA1_POS_REFRESH", SQL_CA1_POS_REFRESH, NULL, 0}, ++ { "SQL_CA1_POSITIONED_UPDATE", SQL_CA1_POSITIONED_UPDATE, NULL, 0}, ++ { "SQL_CA1_POSITIONED_DELETE", SQL_CA1_POSITIONED_DELETE, NULL, 0}, ++ { "SQL_CA1_SELECT_FOR_UPDATE", SQL_CA1_SELECT_FOR_UPDATE, NULL, 0}, ++ { "SQL_CA1_BULK_ADD", SQL_CA1_BULK_ADD, NULL, 0}, ++ { "SQL_CA1_BULK_UPDATE_BY_BOOKMARK", SQL_CA1_BULK_UPDATE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_DELETE_BY_BOOKMARK", SQL_CA1_BULK_DELETE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_FETCH_BY_BOOKMARK", SQL_CA1_BULK_FETCH_BY_BOOKMARK, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2", SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, ++ { ++ { "SQL_CA2_READ_ONLY_CONCURRENCY", SQL_CA2_READ_ONLY_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_LOCK_CONCURRENCY", SQL_CA2_LOCK_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_ROWVER_CONCURRENCY", SQL_CA2_OPT_ROWVER_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_VALUES_CONCURRENCY", SQL_CA2_OPT_VALUES_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_ADDITIONS", SQL_CA2_SENSITIVITY_ADDITIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_DELETIONS", SQL_CA2_SENSITIVITY_DELETIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_UPDATES", SQL_CA2_SENSITIVITY_UPDATES, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_SELECT", SQL_CA2_MAX_ROWS_SELECT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_INSERT", SQL_CA2_MAX_ROWS_INSERT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_DELETE", SQL_CA2_MAX_ROWS_DELETE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_UPDATE", SQL_CA2_MAX_ROWS_UPDATE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_CATALOG", SQL_CA2_MAX_ROWS_CATALOG, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_AFFECTS_ALL", SQL_CA2_MAX_ROWS_AFFECTS_ALL, NULL, 0}, ++ { "SQL_CA2_CRC_EXACT", SQL_CA2_CRC_EXACT, NULL, 0}, ++ { "SQL_CA2_CRC_APPROXIMATE", SQL_CA2_CRC_APPROXIMATE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_NON_UNIQUE", SQL_CA2_SIMULATE_NON_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_TRY_UNIQUE", SQL_CA2_SIMULATE_TRY_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_UNIQUE", SQL_CA2_SIMULATE_UNIQUE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_GETDATA_EXTENSIONS", SQL_GETDATA_EXTENSIONS, ++ { ++ { "SQL_GD_ANY_COLUMN", SQL_GD_ANY_COLUMN, NULL, 0}, ++ { "SQL_GD_ANY_ORDER", SQL_GD_ANY_ORDER, NULL, 0}, ++ { "SQL_GD_BLOCK", SQL_GD_BLOCK, NULL, 0}, ++ { "SQL_GD_BOUND", SQL_GD_BOUND, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_GROUP_BY", SQL_GROUP_BY, ++ { ++ { "SQL_GB_COLLATE", SQL_GB_COLLATE, NULL, 0}, ++ { "SQL_GB_NOT_SUPPORTED", SQL_GB_NOT_SUPPORTED, NULL, 0}, ++ { "SQL_GB_GROUP_BY_EQUALS_SELECT", SQL_GB_GROUP_BY_EQUALS_SELECT, NULL, 0}, ++ { "SQL_GB_GROUP_BY_CONTAINS_SELECT", SQL_GB_GROUP_BY_CONTAINS_SELECT, NULL, 0}, ++ { "SQL_GB_NO_RELATION", SQL_GB_NO_RELATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_IDENTIFIER_CASE", SQL_IDENTIFIER_CASE, ++ { ++ { "SQL_IC_UPPER", SQL_IC_UPPER, NULL, 0}, ++ { "SQL_IC_LOWER", SQL_IC_LOWER, NULL, 0}, ++ { "SQL_IC_SENSITIVE", SQL_IC_SENSITIVE, NULL, 0}, ++ { "SQL_IC_MIXED", SQL_IC_MIXED, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_IDENTIFIER_QUOTE_CHAR", SQL_IDENTIFIER_QUOTE_CHAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_INDEX_KEYWORDS", SQL_INDEX_KEYWORDS, ++ { ++ { "SQL_IK_NONE", SQL_IK_NONE, NULL, 0}, ++ { "SQL_IK_ASC", SQL_IK_ASC, NULL, 0}, ++ { "SQL_IK_DESC", SQL_IK_DESC, NULL, 0}, ++ { "SQL_IK_ALL", SQL_IK_ALL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_INFO_SCHEMA_VIEWS", SQL_INFO_SCHEMA_VIEWS, ++ { ++ { "SQL_ISV_ASSERTIONS", SQL_ISV_ASSERTIONS, NULL, 0}, ++ { "SQL_ISV_CHARACTER_SETS", SQL_ISV_CHARACTER_SETS, NULL, 0}, ++ { "SQL_ISV_CHECK_CONSTRAINTS", SQL_ISV_CHECK_CONSTRAINTS, NULL, 0}, ++ { "SQL_ISV_COLLATIONS", SQL_ISV_COLLATIONS, NULL, 0}, ++ { "SQL_ISV_COLUMN_DOMAIN_USAGE", SQL_ISV_COLUMN_DOMAIN_USAGE, NULL, 0}, ++ { "SQL_ISV_COLUMN_PRIVILEGES", SQL_ISV_COLUMN_PRIVILEGES, NULL, 0}, ++ { "SQL_ISV_COLUMNS", SQL_ISV_COLUMNS, NULL, 0}, ++ { "SQL_ISV_CONSTRAINT_COLUMN_USAGE", SQL_ISV_CONSTRAINT_COLUMN_USAGE, NULL, 0}, ++ { "SQL_ISV_CONSTRAINT_TABLE_USAGE", SQL_ISV_CONSTRAINT_TABLE_USAGE, NULL, 0}, ++ { "SQL_ISV_DOMAIN_CONSTRAINTS", SQL_ISV_DOMAIN_CONSTRAINTS, NULL, 0}, ++ { "SQL_ISV_DOMAINS", SQL_ISV_DOMAINS, NULL, 0}, ++ { "SQL_ISV_KEY_COLUMN_USAGE", SQL_ISV_KEY_COLUMN_USAGE, NULL, 0}, ++ { "SQL_ISV_REFERENTIAL_CONSTRAINTS", SQL_ISV_REFERENTIAL_CONSTRAINTS, NULL, 0}, ++ { "SQL_ISV_SCHEMATA", SQL_ISV_SCHEMATA, NULL, 0}, ++ { "SQL_ISV_SQL_LANGUAGES", SQL_ISV_SQL_LANGUAGES, NULL, 0}, ++ { "SQL_ISV_TABLE_CONSTRAINTS", SQL_ISV_TABLE_CONSTRAINTS, NULL, 0}, ++ { "SQL_ISV_TABLE_PRIVILEGES", SQL_ISV_TABLE_PRIVILEGES, NULL, 0}, ++ { "SQL_ISV_TABLES", SQL_ISV_TABLES, NULL, 0}, ++ { "SQL_ISV_TRANSLATIONS", SQL_ISV_TRANSLATIONS, NULL, 0}, ++ { "SQL_ISV_USAGE_PRIVILEGES", SQL_ISV_USAGE_PRIVILEGES, NULL, 0}, ++ { "SQL_ISV_VIEW_COLUMN_USAGE", SQL_ISV_VIEW_COLUMN_USAGE, NULL, 0}, ++ { "SQL_ISV_VIEW_TABLE_USAGE", SQL_ISV_VIEW_TABLE_USAGE, NULL, 0}, ++ { "SQL_ISV_VIEWS", SQL_ISV_VIEWS, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_INSERT_STATEMENT", SQL_INSERT_STATEMENT, ++ { ++ { "SQL_IS_INSERT_LITERALS", SQL_IS_INSERT_LITERALS, NULL, 0}, ++ { "SQL_IS_INSERT_SEARCHED", SQL_IS_INSERT_SEARCHED, NULL, 0}, ++ { "SQL_IS_SELECT_INTO", SQL_IS_SELECT_INTO, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_INTEGRITY", SQL_INTEGRITY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_KEYSET_CURSOR_ATTRIBUTES1", SQL_KEYSET_CURSOR_ATTRIBUTES1, ++ { ++ { "SQL_CA1_NEXT", SQL_CA1_NEXT, NULL, 0}, ++ { "SQL_CA1_ABSOLUTE", SQL_CA1_ABSOLUTE, NULL, 0}, ++ { "SQL_CA1_RELATIVE", SQL_CA1_RELATIVE, NULL, 0}, ++ { "SQL_CA1_BOOKMARK", SQL_CA1_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_LOCK_EXCLUSIVE", SQL_CA1_LOCK_EXCLUSIVE, NULL, 0}, ++ { "SQL_CA1_LOCK_NO_CHANGE", SQL_CA1_LOCK_NO_CHANGE, NULL, 0}, ++ { "SQL_CA1_LOCK_UNLOCK", SQL_CA1_LOCK_UNLOCK, NULL, 0}, ++ { "SQL_CA1_POS_POSITION", SQL_CA1_POS_POSITION, NULL, 0}, ++ { "SQL_CA1_POS_UPDATE", SQL_CA1_POS_UPDATE, NULL, 0}, ++ { "SQL_CA1_POS_DELETE", SQL_CA1_POS_DELETE, NULL, 0}, ++ { "SQL_CA1_POS_REFRESH", SQL_CA1_POS_REFRESH, NULL, 0}, ++ { "SQL_CA1_POSITIONED_UPDATE", SQL_CA1_POSITIONED_UPDATE, NULL, 0}, ++ { "SQL_CA1_POSITIONED_DELETE", SQL_CA1_POSITIONED_DELETE, NULL, 0}, ++ { "SQL_CA1_SELECT_FOR_UPDATE", SQL_CA1_SELECT_FOR_UPDATE, NULL, 0}, ++ { "SQL_CA1_BULK_ADD", SQL_CA1_BULK_ADD, NULL, 0}, ++ { "SQL_CA1_BULK_UPDATE_BY_BOOKMARK", SQL_CA1_BULK_UPDATE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_DELETE_BY_BOOKMARK", SQL_CA1_BULK_DELETE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_FETCH_BY_BOOKMARK", SQL_CA1_BULK_FETCH_BY_BOOKMARK, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_KEYSET_CURSOR_ATTRIBUTES2", SQL_KEYSET_CURSOR_ATTRIBUTES2, ++ { ++ { "SQL_CA2_READ_ONLY_CONCURRENCY", SQL_CA2_READ_ONLY_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_LOCK_CONCURRENCY", SQL_CA2_LOCK_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_ROWVER_CONCURRENCY", SQL_CA2_OPT_ROWVER_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_VALUES_CONCURRENCY", SQL_CA2_OPT_VALUES_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_ADDITIONS", SQL_CA2_SENSITIVITY_ADDITIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_DELETIONS", SQL_CA2_SENSITIVITY_DELETIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_UPDATES", SQL_CA2_SENSITIVITY_UPDATES, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_SELECT", SQL_CA2_MAX_ROWS_SELECT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_INSERT", SQL_CA2_MAX_ROWS_INSERT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_DELETE", SQL_CA2_MAX_ROWS_DELETE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_UPDATE", SQL_CA2_MAX_ROWS_UPDATE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_CATALOG", SQL_CA2_MAX_ROWS_CATALOG, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_AFFECTS_ALL", SQL_CA2_MAX_ROWS_AFFECTS_ALL, NULL, 0}, ++ { "SQL_CA2_CRC_EXACT", SQL_CA2_CRC_EXACT, NULL, 0}, ++ { "SQL_CA2_CRC_APPROXIMATE", SQL_CA2_CRC_APPROXIMATE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_NON_UNIQUE", SQL_CA2_SIMULATE_NON_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_TRY_UNIQUE", SQL_CA2_SIMULATE_TRY_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_UNIQUE", SQL_CA2_SIMULATE_UNIQUE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_KEYWORDS", SQL_KEYWORDS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_LIKE_ESCAPE_CLAUSE", SQL_LIKE_ESCAPE_CLAUSE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_MAX_ASYNC_CONCURRENT_STATEMENTS", SQL_MAX_ASYNC_CONCURRENT_STATEMENTS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_BINARY_LITERAL_LEN", SQL_MAX_BINARY_LITERAL_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_CATALOG_NAME_LEN", SQL_MAX_CATALOG_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_CHAR_LITERAL_LEN", SQL_MAX_CHAR_LITERAL_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_COLUMN_NAME_LEN", SQL_MAX_COLUMN_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_COLUMNS_IN_GROUP_BY", SQL_MAX_COLUMNS_IN_GROUP_BY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_COLUMNS_IN_INDEX", SQL_MAX_COLUMNS_IN_INDEX, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_COLUMNS_IN_ORDER_BY", SQL_MAX_COLUMNS_IN_ORDER_BY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_COLUMNS_IN_SELECT", SQL_MAX_COLUMNS_IN_SELECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_COLUMNS_IN_TABLE", SQL_MAX_COLUMNS_IN_TABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_CONCURRENT_ACTIVITIES", SQL_MAX_CONCURRENT_ACTIVITIES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_CURSOR_NAME_LEN", SQL_MAX_CURSOR_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_DRIVER_CONNECTIONS", SQL_MAX_DRIVER_CONNECTIONS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_IDENTIFIER_LEN", SQL_MAX_IDENTIFIER_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_INDEX_SIZE", SQL_MAX_INDEX_SIZE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_PROCEDURE_NAME_LEN", SQL_MAX_PROCEDURE_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_ROW_SIZE", SQL_MAX_ROW_SIZE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_MAX_ROW_SIZE_INCLUDES_LONG", SQL_MAX_ROW_SIZE_INCLUDES_LONG, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_MAX_STATEMENT_LEN", SQL_MAX_STATEMENT_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_TABLE_NAME_LEN", SQL_MAX_TABLE_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_TABLES_IN_SELECT", SQL_MAX_TABLES_IN_SELECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MAX_USER_NAME_LEN", SQL_MAX_USER_NAME_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_MULT_RESULT_SETS", SQL_MULT_RESULT_SETS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_MULTIPLE_ACTIVE_TXN", SQL_MULTIPLE_ACTIVE_TXN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_NEED_LONG_DATA_LEN", SQL_NEED_LONG_DATA_LEN, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_NON_NULLABLE_COLUMNS", SQL_NON_NULLABLE_COLUMNS, ++ { ++ { "SQL_NNC_NULL", SQL_NNC_NULL, NULL, 0}, ++ { "SQL_NNC_NON_NULL", SQL_NNC_NON_NULL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_NULL_COLLATION", SQL_NULL_COLLATION, ++ { ++ { "SQL_NC_END", SQL_NC_END, NULL, 0}, ++ { "SQL_NC_HIGH", SQL_NC_HIGH, NULL, 0}, ++ { "SQL_NC_LOW", SQL_NC_LOW, NULL, 0}, ++ { "SQL_NC_START", SQL_NC_START, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_NUMERIC_FUNCTIONS", SQL_NUMERIC_FUNCTIONS, ++ { ++ { "SQL_FN_NUM_ABS", SQL_FN_NUM_ABS, NULL, 0}, ++ { "SQL_FN_NUM_ACOS", SQL_FN_NUM_ACOS, NULL, 0}, ++ { "SQL_FN_NUM_ASIN", SQL_FN_NUM_ASIN, NULL, 0}, ++ { "SQL_FN_NUM_ATAN", SQL_FN_NUM_ATAN, NULL, 0}, ++ { "SQL_FN_NUM_ATAN2", SQL_FN_NUM_ATAN2, NULL, 0}, ++ { "SQL_FN_NUM_CEILING", SQL_FN_NUM_CEILING, NULL, 0}, ++ { "SQL_FN_NUM_COS", SQL_FN_NUM_COS, NULL, 0}, ++ { "SQL_FN_NUM_COT", SQL_FN_NUM_COT, NULL, 0}, ++ { "SQL_FN_NUM_DEGREES", SQL_FN_NUM_DEGREES, NULL, 0}, ++ { "SQL_FN_NUM_EXP", SQL_FN_NUM_EXP, NULL, 0}, ++ { "SQL_FN_NUM_FLOOR", SQL_FN_NUM_FLOOR, NULL, 0}, ++ { "SQL_FN_NUM_LOG", SQL_FN_NUM_LOG, NULL, 0}, ++ { "SQL_FN_NUM_LOG10", SQL_FN_NUM_LOG10, NULL, 0}, ++ { "SQL_FN_NUM_MOD", SQL_FN_NUM_MOD, NULL, 0}, ++ { "SQL_FN_NUM_PI", SQL_FN_NUM_PI, NULL, 0}, ++ { "SQL_FN_NUM_POWER", SQL_FN_NUM_POWER, NULL, 0}, ++ { "SQL_FN_NUM_RADIANS", SQL_FN_NUM_RADIANS, NULL, 0}, ++ { "SQL_FN_NUM_RAND", SQL_FN_NUM_RAND, NULL, 0}, ++ { "SQL_FN_NUM_ROUND", SQL_FN_NUM_ROUND, NULL, 0}, ++ { "SQL_FN_NUM_SIGN", SQL_FN_NUM_SIGN, NULL, 0}, ++ { "SQL_FN_NUM_SIN", SQL_FN_NUM_SIN, NULL, 0}, ++ { "SQL_FN_NUM_SQRT", SQL_FN_NUM_SQRT, NULL, 0}, ++ { "SQL_FN_NUM_TAN", SQL_FN_NUM_TAN, NULL, 0}, ++ { "SQL_FN_NUM_TRUNCATE", SQL_FN_NUM_TRUNCATE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_ODBC_INTERFACE_CONFORMANCE", SQL_ODBC_INTERFACE_CONFORMANCE, ++ { ++ { "SQL_OIC_CORE", SQL_OIC_CORE, NULL, 0}, ++ { "SQL_OIC_LEVEL1", SQL_OIC_LEVEL1, NULL, 0}, ++ { "SQL_OIC_LEVEL2", SQL_OIC_LEVEL2, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ODBC_SAG_CLI_CONFORMANCE", SQL_ODBC_SAG_CLI_CONFORMANCE, ++ { ++ { "SQL_OSCC_NOT_COMPLIANT", SQL_OSCC_NOT_COMPLIANT, NULL, 0}, ++ { "SQL_OSCC_COMPLIANT", SQL_OSCC_COMPLIANT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_ODBC_VER", SQL_ODBC_VER, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_OJ_CAPABILITIES", SQL_OJ_CAPABILITIES, ++ { ++ { "SQL_OJ_LEFT", SQL_OJ_LEFT, NULL, 0}, ++ { "SQL_OJ_RIGHT", SQL_OJ_RIGHT, NULL, 0}, ++ { "SQL_OJ_FULL", SQL_OJ_FULL, NULL, 0}, ++ { "SQL_OJ_NESTED", SQL_OJ_NESTED, NULL, 0}, ++ { "SQL_OJ_NOT_ORDERED", SQL_OJ_NOT_ORDERED, NULL, 0}, ++ { "SQL_OJ_INNER", SQL_OJ_INNER, NULL, 0}, ++ { "SQL_OJ_ALL_COMPARISON_OPS", SQL_OJ_ALL_COMPARISON_OPS, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.01", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_ORDER_BY_COLUMNS_IN_SELECT", SQL_ORDER_BY_COLUMNS_IN_SELECT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_PARAM_ARRAY_ROW_COUNTS", SQL_PARAM_ARRAY_ROW_COUNTS, ++ { ++ { "SQL_PARC_BATCH", SQL_PARC_BATCH, NULL, 0}, ++ { "SQL_PARC_NO_BATCH", SQL_PARC_NO_BATCH, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_PARAM_ARRAY_SELECTS", SQL_PARAM_ARRAY_SELECTS, ++ { ++ { "SQL_PAS_BATCH", SQL_PAS_BATCH, NULL, 0}, ++ { "SQL_PAS_NO_BATCH", SQL_PAS_NO_BATCH, NULL, 0}, ++ { "SQL_PAS_NO_SELECT", SQL_PAS_NO_SELECT, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_PROCEDURE_TERM", SQL_PROCEDURE_TERM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_PROCEDURES", SQL_PROCEDURES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_QUOTED_IDENTIFIER_CASE", SQL_QUOTED_IDENTIFIER_CASE, ++ { ++ { "SQL_IC_UPPER", SQL_IC_UPPER, NULL, 0}, ++ { "SQL_IC_LOWER", SQL_IC_LOWER, NULL, 0}, ++ { "SQL_IC_SENSITIVE", SQL_IC_SENSITIVE, NULL, 0}, ++ { "SQL_IC_MIXED", SQL_IC_MIXED, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_ROW_UPDATES", SQL_ROW_UPDATES, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_SCHEMA_TERM", SQL_SCHEMA_TERM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_SCHEMA_USAGE", SQL_SCHEMA_USAGE, ++ { ++ { "SQL_SU_DML_STATEMENTS", SQL_SU_DML_STATEMENTS, NULL, 0}, ++ { "SQL_SU_PROCEDURE_INVOCATION", SQL_SU_PROCEDURE_INVOCATION, NULL, 0}, ++ { "SQL_SU_TABLE_DEFINITION", SQL_SU_TABLE_DEFINITION, NULL, 0}, ++ { "SQL_SU_INDEX_DEFINITION", SQL_SU_INDEX_DEFINITION, NULL, 0}, ++ { "SQL_SU_PRIVILEGE_DEFINITION", SQL_SU_PRIVILEGE_DEFINITION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SCROLL_OPTIONS", SQL_SCROLL_OPTIONS, ++ { ++ { "SQL_SO_FORWARD_ONLY", SQL_SO_FORWARD_ONLY, NULL, 0}, ++ { "SQL_SO_STATIC", SQL_SO_STATIC, NULL, 0}, ++ { "SQL_SO_KEYSET_DRIVEN", SQL_SO_KEYSET_DRIVEN, NULL, 0}, ++ { "SQL_SO_DYNAMIC", SQL_SO_DYNAMIC, NULL, 0}, ++ { "SQL_SO_MIXED", SQL_SO_MIXED, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SEARCH_PATTERN_ESCAPE", SQL_SEARCH_PATTERN_ESCAPE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_SERVER_NAME", SQL_SERVER_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_SPECIAL_CHARACTERS", SQL_SPECIAL_CHARACTERS, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_SQL_CONFORMANCE", SQL_SQL_CONFORMANCE, ++ { ++ { "SQL_SC_SQL92_ENTRY", SQL_SC_SQL92_ENTRY, NULL, 0}, ++ { "SQL_SC_FIPS127_2_TRANSITIONAL", SQL_SC_FIPS127_2_TRANSITIONAL, NULL, 0}, ++ { "SQL_SC_SQL92_FULL", SQL_SC_SQL92_FULL, NULL, 0}, ++ { "SQL_SC_SQL92_INTERMEDIATE", SQL_SC_SQL92_INTERMEDIATE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_SQL92_DATETIME_FUNCTIONS", SQL_SQL92_DATETIME_FUNCTIONS, ++ { ++ { "SQL_SDF_CURRENT_DATE", SQL_SDF_CURRENT_DATE, NULL, 0}, ++ { "SQL_SDF_CURRENT_TIME", SQL_SDF_CURRENT_TIME, NULL, 0}, ++ { "SQL_SDF_CURRENT_TIMESTAMP", SQL_SDF_CURRENT_TIMESTAMP, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_FOREIGN_KEY_DELETE_RULE", SQL_SQL92_FOREIGN_KEY_DELETE_RULE, ++ { ++ { "SQL_SFKD_CASCADE", SQL_SFKD_CASCADE, NULL, 0}, ++ { "SQL_SFKD_NO_ACTION", SQL_SFKD_NO_ACTION, NULL, 0}, ++ { "SQL_SFKD_SET_DEFAULT", SQL_SFKD_SET_DEFAULT, NULL, 0}, ++ { "SQL_SFKD_SET_NULL", SQL_SFKD_SET_NULL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_FOREIGN_KEY_UPDATE_RULE", SQL_SQL92_FOREIGN_KEY_UPDATE_RULE, ++ { ++ { "SQL_SFKU_CASCADE", SQL_SFKU_CASCADE, NULL, 0}, ++ { "SQL_SFKU_NO_ACTION", SQL_SFKU_NO_ACTION, NULL, 0}, ++ { "SQL_SFKU_SET_DEFAULT", SQL_SFKU_SET_DEFAULT, NULL, 0}, ++ { "SQL_SFKU_SET_NULL", SQL_SFKU_SET_NULL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_GRANT", SQL_SQL92_GRANT, ++ { ++ { "SQL_SG_DELETE_TABLE", SQL_SG_DELETE_TABLE, NULL, 0}, ++ { "SQL_SG_INSERT_COLUMN", SQL_SG_INSERT_COLUMN, NULL, 0}, ++ { "SQL_SG_INSERT_TABLE", SQL_SG_INSERT_TABLE, NULL, 0}, ++ { "SQL_SG_REFERENCES_TABLE", SQL_SG_REFERENCES_TABLE, NULL, 0}, ++ { "SQL_SG_REFERENCES_COLUMN", SQL_SG_REFERENCES_COLUMN, NULL, 0}, ++ { "SQL_SG_SELECT_TABLE", SQL_SG_SELECT_TABLE, NULL, 0}, ++ { "SQL_SG_UPDATE_COLUMN", SQL_SG_UPDATE_COLUMN, NULL, 0}, ++ { "SQL_SG_UPDATE_TABLE", SQL_SG_UPDATE_TABLE, NULL, 0}, ++ { "SQL_SG_USAGE_ON_DOMAIN", SQL_SG_USAGE_ON_DOMAIN, NULL, 0}, ++ { "SQL_SG_USAGE_ON_CHARACTER_SET", SQL_SG_USAGE_ON_CHARACTER_SET, NULL, 0}, ++ { "SQL_SG_USAGE_ON_COLLATION", SQL_SG_USAGE_ON_COLLATION, NULL, 0}, ++ { "SQL_SG_USAGE_ON_TRANSLATION", SQL_SG_USAGE_ON_TRANSLATION, NULL, 0}, ++ { "SQL_SG_WITH_GRANT_OPTION", SQL_SG_WITH_GRANT_OPTION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_NUMERIC_VALUE_FUNCTIONS", SQL_SQL92_NUMERIC_VALUE_FUNCTIONS, ++ { ++ { "SQL_SNVF_BIT_LENGTH", SQL_SNVF_BIT_LENGTH, NULL, 0}, ++ { "SQL_SNVF_CHAR_LENGTH", SQL_SNVF_CHAR_LENGTH, NULL, 0}, ++ { "SQL_SNVF_CHARACTER_LENGTH", SQL_SNVF_CHARACTER_LENGTH, NULL, 0}, ++ { "SQL_SNVF_EXTRACT", SQL_SNVF_EXTRACT, NULL, 0}, ++ { "SQL_SNVF_OCTET_LENGTH", SQL_SNVF_OCTET_LENGTH, NULL, 0}, ++ { "SQL_SNVF_POSITION", SQL_SNVF_POSITION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_PREDICATES", SQL_SQL92_PREDICATES, ++ { ++ { "SQL_SP_BETWEEN", SQL_SP_BETWEEN, NULL, 0}, ++ { "SQL_SP_COMPARISON", SQL_SP_COMPARISON, NULL, 0}, ++ { "SQL_SP_EXISTS", SQL_SP_EXISTS, NULL, 0}, ++ { "SQL_SP_IN", SQL_SP_IN, NULL, 0}, ++ { "SQL_SP_ISNOTNULL", SQL_SP_ISNOTNULL, NULL, 0}, ++ { "SQL_SP_ISNULL", SQL_SP_ISNULL, NULL, 0}, ++ { "SQL_SP_LIKE", SQL_SP_LIKE, NULL, 0}, ++ { "SQL_SP_MATCH_FULL", SQL_SP_MATCH_FULL, NULL, 0}, ++ { "SQL_SP_MATCH_PARTIAL", SQL_SP_MATCH_PARTIAL, NULL, 0}, ++ { "SQL_SP_MATCH_UNIQUE_FULL", SQL_SP_MATCH_UNIQUE_FULL, NULL, 0}, ++ { "SQL_SP_MATCH_UNIQUE_PARTIAL", SQL_SP_MATCH_UNIQUE_PARTIAL, NULL, 0}, ++ { "SQL_SP_OVERLAPS", SQL_SP_OVERLAPS, NULL, 0}, ++ { "SQL_SP_QUANTIFIED_COMPARISON", SQL_SP_QUANTIFIED_COMPARISON, NULL, 0}, ++ { "SQL_SP_UNIQUE", SQL_SP_UNIQUE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_RELATIONAL_JOIN_OPERATORS", SQL_SQL92_RELATIONAL_JOIN_OPERATORS, ++ { ++ { "SQL_SRJO_CORRESPONDING_CLAUSE", SQL_SRJO_CORRESPONDING_CLAUSE, NULL, 0}, ++ { "SQL_SRJO_CROSS_JOIN", SQL_SRJO_CROSS_JOIN, NULL, 0}, ++ { "SQL_SRJO_EXCEPT_JOIN", SQL_SRJO_EXCEPT_JOIN, NULL, 0}, ++ { "SQL_SRJO_FULL_OUTER_JOIN", SQL_SRJO_FULL_OUTER_JOIN, NULL, 0}, ++ { "SQL_SRJO_INNER_JOIN", SQL_SRJO_INNER_JOIN, NULL, 0}, ++ { "SQL_SRJO_INTERSECT_JOIN", SQL_SRJO_INTERSECT_JOIN, NULL, 0}, ++ { "SQL_SRJO_LEFT_OUTER_JOIN", SQL_SRJO_LEFT_OUTER_JOIN, NULL, 0}, ++ { "SQL_SRJO_NATURAL_JOIN", SQL_SRJO_NATURAL_JOIN, NULL, 0}, ++ { "SQL_SRJO_RIGHT_OUTER_JOIN", SQL_SRJO_RIGHT_OUTER_JOIN, NULL, 0}, ++ { "SQL_SRJO_UNION_JOIN", SQL_SRJO_UNION_JOIN, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_REVOKE", SQL_SQL92_REVOKE, ++ { ++ { "SQL_SR_CASCADE", SQL_SR_CASCADE, NULL, 0}, ++ { "SQL_SR_DELETE_TABLE", SQL_SR_DELETE_TABLE, NULL, 0}, ++ { "SQL_SR_GRANT_OPTION_FOR", SQL_SR_GRANT_OPTION_FOR, NULL, 0}, ++ { "SQL_SR_INSERT_COLUMN", SQL_SR_INSERT_COLUMN, NULL, 0}, ++ { "SQL_SR_INSERT_TABLE", SQL_SR_INSERT_TABLE, NULL, 0}, ++ { "SQL_SR_REFERENCES_COLUMN", SQL_SR_REFERENCES_COLUMN, NULL, 0}, ++ { "SQL_SR_REFERENCES_TABLE", SQL_SR_REFERENCES_TABLE, NULL, 0}, ++ { "SQL_SR_RESTRICT", SQL_SR_RESTRICT, NULL, 0}, ++ { "SQL_SR_SELECT_TABLE", SQL_SR_SELECT_TABLE, NULL, 0}, ++ { "SQL_SR_UPDATE_COLUMN", SQL_SR_UPDATE_COLUMN, NULL, 0}, ++ { "SQL_SR_UPDATE_TABLE", SQL_SR_UPDATE_TABLE, NULL, 0}, ++ { "SQL_SR_USAGE_ON_DOMAIN", SQL_SR_USAGE_ON_DOMAIN, NULL, 0}, ++ { "SQL_SR_USAGE_ON_CHARACTER_SET", SQL_SR_USAGE_ON_CHARACTER_SET, NULL, 0}, ++ { "SQL_SR_USAGE_ON_COLLATION", SQL_SR_USAGE_ON_COLLATION, NULL, 0}, ++ { "SQL_SR_USAGE_ON_TRANSLATION", SQL_SR_USAGE_ON_TRANSLATION, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_ROW_VALUE_CONSTRUCTOR", SQL_SQL92_ROW_VALUE_CONSTRUCTOR, ++ { ++ { "SQL_SRVC_VALUE_EXPRESSION", SQL_SRVC_VALUE_EXPRESSION, NULL, 0}, ++ { "SQL_SRVC_NULL", SQL_SRVC_NULL, NULL, 0}, ++ { "SQL_SRVC_DEFAULT", SQL_SRVC_DEFAULT, NULL, 0}, ++ { "SQL_SRVC_ROW_SUBQUERY", SQL_SRVC_ROW_SUBQUERY, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_STRING_FUNCTIONS", SQL_SQL92_STRING_FUNCTIONS, ++ { ++ { "SQL_SSF_CONVERT", SQL_SSF_CONVERT, NULL, 0}, ++ { "SQL_SSF_LOWER", SQL_SSF_LOWER, NULL, 0}, ++ { "SQL_SSF_UPPER", SQL_SSF_UPPER, NULL, 0}, ++ { "SQL_SSF_SUBSTRING", SQL_SSF_SUBSTRING, NULL, 0}, ++ { "SQL_SSF_TRANSLATE", SQL_SSF_TRANSLATE, NULL, 0}, ++ { "SQL_SSF_TRIM_BOTH", SQL_SSF_TRIM_BOTH, NULL, 0}, ++ { "SQL_SSF_TRIM_LEADING", SQL_SSF_TRIM_LEADING, NULL, 0}, ++ { "SQL_SSF_TRIM_TRAILING", SQL_SSF_TRIM_TRAILING, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SQL92_VALUE_EXPRESSIONS", SQL_SQL92_VALUE_EXPRESSIONS, ++ { ++ { "SQL_SVE_CASE", SQL_SVE_CASE, NULL, 0}, ++ { "SQL_SVE_CAST", SQL_SVE_CAST, NULL, 0}, ++ { "SQL_SVE_COALESCE", SQL_SVE_COALESCE, NULL, 0}, ++ { "SQL_SVE_NULLIF", SQL_SVE_NULLIF, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_STANDARD_CLI_CONFORMANCE", SQL_STANDARD_CLI_CONFORMANCE, ++ { ++ { "SQL_SCC_XOPEN_CLI_VERSION1", SQL_SCC_XOPEN_CLI_VERSION1, NULL, 0}, ++ { "SQL_SCC_ISO92_CLI", SQL_SCC_ISO92_CLI, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_STATIC_CURSOR_ATTRIBUTES1", SQL_STATIC_CURSOR_ATTRIBUTES1, ++ { ++ { "SQL_CA1_NEXT", SQL_CA1_NEXT, NULL, 0}, ++ { "SQL_CA1_ABSOLUTE", SQL_CA1_ABSOLUTE, NULL, 0}, ++ { "SQL_CA1_RELATIVE", SQL_CA1_RELATIVE, NULL, 0}, ++ { "SQL_CA1_BOOKMARK", SQL_CA1_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_LOCK_EXCLUSIVE", SQL_CA1_LOCK_EXCLUSIVE, NULL, 0}, ++ { "SQL_CA1_LOCK_NO_CHANGE", SQL_CA1_LOCK_NO_CHANGE, NULL, 0}, ++ { "SQL_CA1_LOCK_UNLOCK", SQL_CA1_LOCK_UNLOCK, NULL, 0}, ++ { "SQL_CA1_POS_POSITION", SQL_CA1_POS_POSITION, NULL, 0}, ++ { "SQL_CA1_POS_UPDATE", SQL_CA1_POS_UPDATE, NULL, 0}, ++ { "SQL_CA1_POS_DELETE", SQL_CA1_POS_DELETE, NULL, 0}, ++ { "SQL_CA1_POS_REFRESH", SQL_CA1_POS_REFRESH, NULL, 0}, ++ { "SQL_CA1_POSITIONED_UPDATE", SQL_CA1_POSITIONED_UPDATE, NULL, 0}, ++ { "SQL_CA1_POSITIONED_DELETE", SQL_CA1_POSITIONED_DELETE, NULL, 0}, ++ { "SQL_CA1_SELECT_FOR_UPDATE", SQL_CA1_SELECT_FOR_UPDATE, NULL, 0}, ++ { "SQL_CA1_BULK_ADD", SQL_CA1_BULK_ADD, NULL, 0}, ++ { "SQL_CA1_BULK_UPDATE_BY_BOOKMARK", SQL_CA1_BULK_UPDATE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_DELETE_BY_BOOKMARK", SQL_CA1_BULK_DELETE_BY_BOOKMARK, NULL, 0}, ++ { "SQL_CA1_BULK_FETCH_BY_BOOKMARK", SQL_CA1_BULK_FETCH_BY_BOOKMARK, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_STATIC_CURSOR_ATTRIBUTES2", SQL_STATIC_CURSOR_ATTRIBUTES2, ++ { ++ { "SQL_CA2_READ_ONLY_CONCURRENCY", SQL_CA2_READ_ONLY_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_LOCK_CONCURRENCY", SQL_CA2_LOCK_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_ROWVER_CONCURRENCY", SQL_CA2_OPT_ROWVER_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_OPT_VALUES_CONCURRENCY", SQL_CA2_OPT_VALUES_CONCURRENCY, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_ADDITIONS", SQL_CA2_SENSITIVITY_ADDITIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_DELETIONS", SQL_CA2_SENSITIVITY_DELETIONS, NULL, 0}, ++ { "SQL_CA2_SENSITIVITY_UPDATES", SQL_CA2_SENSITIVITY_UPDATES, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_SELECT", SQL_CA2_MAX_ROWS_SELECT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_INSERT", SQL_CA2_MAX_ROWS_INSERT, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_DELETE", SQL_CA2_MAX_ROWS_DELETE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_UPDATE", SQL_CA2_MAX_ROWS_UPDATE, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_CATALOG", SQL_CA2_MAX_ROWS_CATALOG, NULL, 0}, ++ { "SQL_CA2_MAX_ROWS_AFFECTS_ALL", SQL_CA2_MAX_ROWS_AFFECTS_ALL, NULL, 0}, ++ { "SQL_CA2_CRC_EXACT", SQL_CA2_CRC_EXACT, NULL, 0}, ++ { "SQL_CA2_CRC_APPROXIMATE", SQL_CA2_CRC_APPROXIMATE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_NON_UNIQUE", SQL_CA2_SIMULATE_NON_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_TRY_UNIQUE", SQL_CA2_SIMULATE_TRY_UNIQUE, NULL, 0}, ++ { "SQL_CA2_SIMULATE_UNIQUE", SQL_CA2_SIMULATE_UNIQUE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_STRING_FUNCTIONS", SQL_STRING_FUNCTIONS, ++ { ++ { "SQL_FN_STR_ASCII", SQL_FN_STR_ASCII, NULL, 0}, ++ { "SQL_FN_STR_BIT_LENGTH", SQL_FN_STR_BIT_LENGTH, NULL, 0}, ++ { "SQL_FN_STR_CHAR", SQL_FN_STR_CHAR, NULL, 0}, ++ { "SQL_FN_STR_CHAR_LENGTH", SQL_FN_STR_CHAR_LENGTH, NULL, 0}, ++ { "SQL_FN_STR_CHARACTER_LENGTH", SQL_FN_STR_CHARACTER_LENGTH, NULL, 0}, ++ { "SQL_FN_STR_CONCAT", SQL_FN_STR_CONCAT, NULL, 0}, ++ { "SQL_FN_STR_DIFFERENCE", SQL_FN_STR_DIFFERENCE, NULL, 0}, ++ { "SQL_FN_STR_INSERT", SQL_FN_STR_INSERT, NULL, 0}, ++ { "SQL_FN_STR_LCASE", SQL_FN_STR_LCASE, NULL, 0}, ++ { "SQL_FN_STR_LEFT", SQL_FN_STR_LEFT, NULL, 0}, ++ { "SQL_FN_STR_LENGTH", SQL_FN_STR_LENGTH, NULL, 0}, ++ { "SQL_FN_STR_LOCATE", SQL_FN_STR_LOCATE, NULL, 0}, ++ { "SQL_FN_STR_LTRIM", SQL_FN_STR_LTRIM, NULL, 0}, ++ { "SQL_FN_STR_OCTET_LENGTH", SQL_FN_STR_OCTET_LENGTH, NULL, 0}, ++ { "SQL_FN_STR_POSITION", SQL_FN_STR_POSITION, NULL, 0}, ++ { "SQL_FN_STR_REPEAT", SQL_FN_STR_REPEAT, NULL, 0}, ++ { "SQL_FN_STR_REPLACE", SQL_FN_STR_REPLACE, NULL, 0}, ++ { "SQL_FN_STR_RIGHT", SQL_FN_STR_RIGHT, NULL, 0}, ++ { "SQL_FN_STR_RTRIM", SQL_FN_STR_RTRIM, NULL, 0}, ++ { "SQL_FN_STR_SOUNDEX", SQL_FN_STR_SOUNDEX, NULL, 0}, ++ { "SQL_FN_STR_SPACE", SQL_FN_STR_SPACE, NULL, 0}, ++ { "SQL_FN_STR_SUBSTRING", SQL_FN_STR_SUBSTRING, NULL, 0}, ++ { "SQL_FN_STR_UCASE", SQL_FN_STR_UCASE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SUBQUERIES", SQL_SUBQUERIES, ++ { ++ { "SQL_SQ_CORRELATED_SUBQUERIES", SQL_SQ_CORRELATED_SUBQUERIES, NULL, 0}, ++ { "SQL_SQ_COMPARISON", SQL_SQ_COMPARISON, NULL, 0}, ++ { "SQL_SQ_EXISTS", SQL_SQ_EXISTS, NULL, 0}, ++ { "SQL_SQ_IN", SQL_SQ_IN, NULL, 0}, ++ { "SQL_SQ_QUANTIFIED", SQL_SQ_QUANTIFIED, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_SYSTEM_FUNCTIONS", SQL_SYSTEM_FUNCTIONS, ++ { ++ { "SQL_FN_SYS_DBNAME", SQL_FN_SYS_DBNAME, NULL, 0}, ++ { "SQL_FN_SYS_IFNULL", SQL_FN_SYS_IFNULL, NULL, 0}, ++ { "SQL_FN_SYS_USERNAME", SQL_FN_SYS_USERNAME, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_TABLE_TERM", SQL_TABLE_TERM, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_TIMEDATE_ADD_INTERVALS", SQL_TIMEDATE_ADD_INTERVALS, ++ { ++ { "SQL_FN_TSI_FRAC_SECOND", SQL_FN_TSI_FRAC_SECOND, NULL, 0}, ++ { "SQL_FN_TSI_SECOND", SQL_FN_TSI_SECOND, NULL, 0}, ++ { "SQL_FN_TSI_MINUTE", SQL_FN_TSI_MINUTE, NULL, 0}, ++ { "SQL_FN_TSI_HOUR", SQL_FN_TSI_HOUR, NULL, 0}, ++ { "SQL_FN_TSI_DAY", SQL_FN_TSI_DAY, NULL, 0}, ++ { "SQL_FN_TSI_WEEK", SQL_FN_TSI_WEEK, NULL, 0}, ++ { "SQL_FN_TSI_MONTH", SQL_FN_TSI_MONTH, NULL, 0}, ++ { "SQL_FN_TSI_QUARTER", SQL_FN_TSI_QUARTER, NULL, 0}, ++ { "SQL_FN_TSI_YEAR", SQL_FN_TSI_YEAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_TIMEDATE_DIFF_INTERVALS", SQL_TIMEDATE_DIFF_INTERVALS, ++ { ++ { "SQL_FN_TSI_FRAC_SECOND", SQL_FN_TSI_FRAC_SECOND, NULL, 0}, ++ { "SQL_FN_TSI_SECOND", SQL_FN_TSI_SECOND, NULL, 0}, ++ { "SQL_FN_TSI_MINUTE", SQL_FN_TSI_MINUTE, NULL, 0}, ++ { "SQL_FN_TSI_HOUR", SQL_FN_TSI_HOUR, NULL, 0}, ++ { "SQL_FN_TSI_DAY", SQL_FN_TSI_DAY, NULL, 0}, ++ { "SQL_FN_TSI_WEEK", SQL_FN_TSI_WEEK, NULL, 0}, ++ { "SQL_FN_TSI_MONTH", SQL_FN_TSI_MONTH, NULL, 0}, ++ { "SQL_FN_TSI_QUARTER", SQL_FN_TSI_QUARTER, NULL, 0}, ++ { "SQL_FN_TSI_YEAR", SQL_FN_TSI_YEAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_TIMEDATE_FUNCTIONS", SQL_TIMEDATE_FUNCTIONS, ++ { ++ { "SQL_FN_TD_CURRENT_DATE", SQL_FN_TD_CURRENT_DATE, NULL, 0}, ++ { "SQL_FN_TD_CURRENT_TIME", SQL_FN_TD_CURRENT_TIME, NULL, 0}, ++ { "SQL_FN_TD_CURRENT_TIMESTAMP", SQL_FN_TD_CURRENT_TIMESTAMP, NULL, 0}, ++ { "SQL_FN_TD_CURDATE", SQL_FN_TD_CURDATE, NULL, 0}, ++ { "SQL_FN_TD_CURTIME", SQL_FN_TD_CURTIME, NULL, 0}, ++ { "SQL_FN_TD_DAYNAME", SQL_FN_TD_DAYNAME, NULL, 0}, ++ { "SQL_FN_TD_DAYOFMONTH", SQL_FN_TD_DAYOFMONTH, NULL, 0}, ++ { "SQL_FN_TD_DAYOFWEEK", SQL_FN_TD_DAYOFWEEK, NULL, 0}, ++ { "SQL_FN_TD_DAYOFYEAR", SQL_FN_TD_DAYOFYEAR, NULL, 0}, ++ { "SQL_FN_TD_EXTRACT", SQL_FN_TD_EXTRACT, NULL, 0}, ++ { "SQL_FN_TD_HOUR", SQL_FN_TD_HOUR, NULL, 0}, ++ { "SQL_FN_TD_MINUTE", SQL_FN_TD_MINUTE, NULL, 0}, ++ { "SQL_FN_TD_MONTH", SQL_FN_TD_MONTH, NULL, 0}, ++ { "SQL_FN_TD_MONTHNAME", SQL_FN_TD_MONTHNAME, NULL, 0}, ++ { "SQL_FN_TD_NOW", SQL_FN_TD_NOW, NULL, 0}, ++ { "SQL_FN_TD_QUARTER", SQL_FN_TD_QUARTER, NULL, 0}, ++ { "SQL_FN_TD_SECOND", SQL_FN_TD_SECOND, NULL, 0}, ++ { "SQL_FN_TD_TIMESTAMPADD", SQL_FN_TD_TIMESTAMPADD, NULL, 0}, ++ { "SQL_FN_TD_TIMESTAMPDIFF", SQL_FN_TD_TIMESTAMPDIFF, NULL, 0}, ++ { "SQL_FN_TD_WEEK", SQL_FN_TD_WEEK, NULL, 0}, ++ { "SQL_FN_TD_YEAR", SQL_FN_TD_YEAR, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_TXN_CAPABLE", SQL_TXN_CAPABLE, ++ { ++ { "SQL_TC_NONE", SQL_TC_NONE, NULL, 0}, ++ { "SQL_TC_DML", SQL_TC_DML, NULL, 0}, ++ { "SQL_TC_DDL_COMMIT", SQL_TC_DDL_COMMIT, NULL, 0}, ++ { "SQL_TC_DDL_IGNORE", SQL_TC_DDL_IGNORE, NULL, 0}, ++ { "SQL_TC_ALL", SQL_TC_ALL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_SMALLINT, 0, 0 ++ }, ++ { "SQL_TXN_ISOLATION_OPTION", SQL_TXN_ISOLATION_OPTION, ++ { ++ { "SQL_TXN_READ_UNCOMMITTED", SQL_TXN_READ_UNCOMMITTED, NULL, 0}, ++ { "SQL_TXN_READ_COMMITTED", SQL_TXN_READ_COMMITTED, NULL, 0}, ++ { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ, NULL, 0}, ++ { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_UNION", SQL_UNION, ++ { ++ { "SQL_U_UNION", SQL_U_UNION, NULL, 0}, ++ { "SQL_U_UNION_ALL", SQL_U_UNION_ALL, NULL, 0}, ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, TRUE, 0 ++ }, ++ { "SQL_USER_NAME", SQL_USER_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_XOPEN_CLI_YEAR", SQL_XOPEN_CLI_YEAR, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++void dDriverConnect::out_str_clkd() ++{ ++ if ( out_str_valid->isChecked() ) ++ out_str_valid->setText( "OutConnectionString: SQL_NULL_POINTER" ); ++ else ++ out_str_valid->setText( "OutConnectionString: VALID" ); ++} ++ ++void dDriverConnect::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLenPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLenPtr: VALID" ); ++} ++ ++void dDriverConnect::Ok() ++{ ++ const char *in_string, *string_len; ++ SQLCHAR *conn_str_in; ++ SQLCHAR *out_string; ++ SQLINTEGER in_string_len, con_str_out_max; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle; ++ SQLSMALLINT con_str_out, *ptr_con_str_out; ++ SQLUSMALLINT dc_type; ++ int index; ++ QString qstring_len, qin_string; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qstring_len = str_len->currentText(); ++ string_len = qstring_len.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLDriverConnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " Window Handle: NULL" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qin_string = in_str->currentText(); ++ in_string = qin_string.toUtf8().constData(); ++ ++ if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = NULL; ++ pOdbcTest->out_win->append( " InConnectionString: " ); ++ } ++ else if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = ( SQLCHAR * ) ""; ++ pOdbcTest->out_win->append( " InConnectionString: " ); ++ } ++ else ++ { ++ txt.sprintf( " InConnectionString: %s", in_string ); ++ conn_str_in = ( SQLCHAR * ) in_string; ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( string_len, "SQL_NTS", 7 ) == 0 ) ++ { ++ in_string_len = SQL_NTS; ++ txt.sprintf( " StringLength1: SQL_NTS=-3" ); ++ } ++ else ++ { ++ in_string_len = atoi( string_len ); ++ txt.sprintf( " StringLength1: %d", in_string_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out_max = buffer_len->text().toInt(); ++ ++ if ( out_str_valid->isChecked()) ++ { ++ out_string = ( SQLCHAR * ) NULL; ++ } ++ else if ( con_str_out_max < 300 ) ++ { ++ out_string = new SQLCHAR[ 300 ]; ++ } ++ else ++ { ++ out_string = new SQLCHAR[ con_str_out_max ]; ++ } ++ ++ if ( out_string ) ++ { ++ txt.sprintf( " OutConnectionString: %p", out_string ); ++ } ++ else ++ { ++ txt.sprintf( " OutConnectionString: NULL_POINTER" ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " Buffer Length %d", con_str_out_max ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked()) ++ { ++ ptr_con_str_out = NULL; ++ txt.sprintf( " StringLengthPtr: NULL_POINTER" ); ++ } ++ else ++ { ++ ptr_con_str_out = &con_str_out; ++ txt.sprintf( " StringLengthPtr: %p", ptr_con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out = -9999; ++ ++ index = driver_completion->currentIndex(); ++ ++ dc_type = dc_options[ index ].attr; ++ txt.sprintf( " Driver Complete: %s=%d (%s)", dc_options[ index ].text, ++ dc_options[ index ].attr, dc_options[ index ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLHWND hWnd = NULL; ++ ++#ifdef WIN32 ++ hWnd = (SQLHWND)(this->winId()); ++#else ++ ODBCINSTWND Wnd; ++ ++ strcpy( Wnd.szUI, "odbcinstQ4" ); ++ Wnd.hWnd = this; ++ hWnd = (SQLHWND)(&Wnd); ++#endif ++ ++ SQLRETURN ret = SQLDriverConnect( in_handle, ++ hWnd, ++ conn_str_in, ++ in_string_len, ++ out_string, ++ con_str_out_max, ++ ptr_con_str_out, ++ dc_type ); ++ ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( out_string ) ++ { ++ txt.sprintf( " OutConnectionString: %s", out_string ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( ptr_con_str_out ) ++ { ++ if ( con_str_out == -9999 ) ++ { ++ txt.sprintf( " *StrLenPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *StrLenPtr: %d", con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dDriverConnect::dDriverConnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ in_str = new QComboBox( this ); ++ in_str->setEditable( true ); ++ in_str->setGeometry( 130, 50, 300, 20 ); ++ l_in_str = new QLabel( "InConnectionString:", this ); ++ l_in_str->setGeometry( 10, 50, 90, 20 ); ++ in_str->insertItem( 0, "" ); ++ in_str->insertItem( 1, "" ); ++ ++ str_len = new QComboBox( this ); ++ str_len->setEditable( true ); ++ str_len->setGeometry( 130, 80, 150, 20 ); ++ l_str_len = new QLabel( "StringLength1:", this ); ++ l_str_len->setGeometry( 10, 80, 90, 20 ); ++ str_len->insertItem( 0, "SQL_NTS=-3" ); ++ str_len->insertItem( 1, "0" ); ++ ++ out_str_valid = new QCheckBox( "OutConnectionString: VALID", this ); ++ out_str_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLenPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 80, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 80, 60, 20 ); ++ ++ driver_completion = new QComboBox( this ); ++ driver_completion->setGeometry( 100, 170, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( dc_options, driver_completion ); ++ ++ l_driver_completion = new QLabel( "Driver Completion:", this ); ++ l_driver_completion->setGeometry( 10, 170, 80, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( out_str_valid, SIGNAL( clicked()), this, SLOT( out_str_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dDriverConnect::~dDriverConnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete in_str; ++ delete str_len; ++ delete l_handle; ++ delete l_in_str; ++ delete l_str_len; ++ delete out_str_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++ delete driver_completion; ++ delete l_driver_completion; ++} ++ ++void dBrowseConnect::out_str_clkd() ++{ ++ if ( out_str_valid->isChecked() ) ++ out_str_valid->setText( "OutConnectionString: SQL_NULL_POINTER" ); ++ else ++ out_str_valid->setText( "OutConnectionString: VALID" ); ++} ++ ++void dBrowseConnect::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLenPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLenPtr: VALID" ); ++} ++ ++void dBrowseConnect::Ok() ++{ ++ const char *in_string, *string_len; ++ SQLCHAR *conn_str_in; ++ SQLCHAR *out_string; ++ SQLINTEGER in_string_len, con_str_out_max; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle; ++ SQLSMALLINT con_str_out, *ptr_con_str_out; ++ QString qstring_len, qin_string; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qstring_len = str_len->currentText(); ++ string_len = qstring_len.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLBrowseConnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qin_string = in_str->currentText(); ++ in_string = qin_string.toUtf8().constData(); ++ ++ if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = NULL; ++ pOdbcTest->out_win->append( " InConnectionString: " ); ++ } ++ else if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = ( SQLCHAR * ) ""; ++ pOdbcTest->out_win->append( " InConnectionString: " ); ++ } ++ else ++ { ++ txt.sprintf( " InConnectionString: %s", in_string ); ++ conn_str_in = ( SQLCHAR * ) in_string; ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( string_len, "SQL_NTS", 7 ) == 0 ) ++ { ++ in_string_len = SQL_NTS; ++ txt.sprintf( " StringLength1: SQL_NTS=-3" ); ++ } ++ else ++ { ++ in_string_len = atoi( string_len ); ++ txt.sprintf( " StringLength1: %d", in_string_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out_max = buffer_len->text().toInt(); ++ ++ if ( out_str_valid->isChecked()) ++ { ++ out_string = ( SQLCHAR * ) NULL; ++ } ++ else if ( con_str_out_max < 300 ) ++ { ++ out_string = new SQLCHAR[ 300 ]; ++ } ++ else ++ { ++ out_string = new SQLCHAR[ con_str_out_max ]; ++ } ++ ++ if ( out_string ) ++ { ++ txt.sprintf( " OutConnectionString: %p", out_string ); ++ } ++ else ++ { ++ txt.sprintf( " OutConnectionString: NULL_POINTER" ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " Buffer Length %d", con_str_out_max ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked()) ++ { ++ ptr_con_str_out = NULL; ++ txt.sprintf( " StringLengthPtr: NULL_POINTER" ); ++ } ++ else ++ { ++ ptr_con_str_out = &con_str_out; ++ txt.sprintf( " StringLengthPtr: %p", ptr_con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out = -9999; ++ ++ SQLRETURN ret = SQLBrowseConnect( in_handle, ++ conn_str_in, ++ in_string_len, ++ out_string, ++ con_str_out_max, ++ ptr_con_str_out ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) || (SQL_NEED_DATA == ret)) ++ { ++ if ( out_string ) ++ { ++ txt.sprintf( " OutConnectionString: %s", out_string ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( ptr_con_str_out ) ++ { ++ if ( con_str_out == -9999 ) ++ { ++ txt.sprintf( " *StrLenPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *StrLenPtr: %d", con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ if ( out_string ) ++ { ++ delete out_string; ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dBrowseConnect::dBrowseConnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ in_str = new QComboBox( this ); ++ in_str->setEditable( true ); ++ in_str->setGeometry( 130, 50, 300, 20 ); ++ l_in_str = new QLabel( "InConnectionString:", this ); ++ l_in_str->setGeometry( 10, 50, 90, 20 ); ++ in_str->insertItem( 0, "" ); ++ in_str->insertItem( 1, "" ); ++ ++ str_len = new QComboBox( this ); ++ str_len->setEditable( true ); ++ str_len->setGeometry( 130, 80, 150, 20 ); ++ l_str_len = new QLabel( "StringLength1:", this ); ++ l_str_len->setGeometry( 10, 80, 90, 20 ); ++ str_len->insertItem( 0, "SQL_NTS=-3" ); ++ str_len->insertItem( 1, "0" ); ++ ++ out_str_valid = new QCheckBox( "OutConnectionString: VALID", this ); ++ out_str_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLenPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 80, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 80, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( out_str_valid, SIGNAL( clicked()), this, SLOT( out_str_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dBrowseConnect::~dBrowseConnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete in_str; ++ delete str_len; ++ delete l_handle; ++ delete l_in_str; ++ delete l_str_len; ++ delete out_str_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dDisconnect::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLDisconnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLDisconnect( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dDisconnect::dDisconnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 110,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 190,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 270,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 140, 50, 200, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Connection Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dDisconnect::~dDisconnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++} ++ ++void dFullConnect::set_dsn( const QString & s ) ++{ ++ dsn->setText( s ); ++} ++ ++void dFullConnect::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLINTEGER odbc_ver, odbc_cur; ++ SQLHANDLE henv, hdbc, hstmt; ++ SQLRETURN ret; ++ ++ henv = SQL_NULL_HENV; ++ ++ /* ++ * do we need to allocate a env handle ? ++ */ ++ ++ if ( !hand ) ++ { ++ ret = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HENV, &henv ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLAllocHandle( SQL_HANDLE_ENV ) failed" ); ++ return; ++ } ++ ++ /* ++ * set the odbc version ++ */ ++ ++ if ( ver_2->isChecked() ) ++ odbc_ver = SQL_OV_ODBC2; ++ else if ( ver_3->isChecked() ) ++ odbc_ver = SQL_OV_ODBC3; ++ else ++ odbc_ver = SQL_OV_ODBC3; ++ ++ ret = SQLSetEnvAttr( henv, SQL_ATTR_ODBC_VERSION, ( SQLPOINTER ) odbc_ver, 0 ); ++ pOdbcTest->dumpError( SQL_HANDLE_ENV, henv ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLSetEnvAttr( SQL_ATTR_ODBC_VERSION ) failed" ); ++ return; ++ } ++ } ++ else ++ { ++ henv = hand->getHandle(); ++ } ++ ++ /* ++ * allocate a dbc handle ++ */ ++ ++ ret = SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc ); ++ pOdbcTest->dumpError( SQL_HANDLE_ENV, henv ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLAllocHandle( SQL_HANDLE_DBC ) failed" ); ++ if ( !hand ) ++ { ++ SQLFreeHandle( SQL_HANDLE_ENV, henv ); ++ } ++ return; ++ } ++ ++ /* ++ * set the cursor lib setting ++ */ ++ ++ if ( cur_ifneeded->isChecked() ) ++ odbc_cur = SQL_CUR_USE_IF_NEEDED; ++ else if ( cur_use->isChecked() ) ++ odbc_cur = SQL_CUR_USE_ODBC; ++ else if ( cur_driver->isChecked() ) ++ odbc_cur = SQL_CUR_USE_DRIVER; ++ else ++ odbc_cur = SQL_CUR_DEFAULT; ++ ++ ret = SQLSetConnectAttr( hdbc, SQL_ODBC_CURSORS, ( SQLPOINTER ) odbc_cur, 0 ); ++ pOdbcTest->dumpError( SQL_HANDLE_DBC, hdbc ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLSetConnectAttr( SQL_ODBC_CURSORS ) failed" ); ++ SQLFreeHandle( SQL_HANDLE_DBC, hdbc ); ++ if ( !hand ) ++ { ++ SQLFreeHandle( SQL_HANDLE_ENV, henv ); ++ } ++ return; ++ } ++ ++ /* ++ * connect ++ */ ++ ++ char cstr[ 1024 ], tmp[ 1024 ]; ++ ++ QString qdsn = dsn->text(); ++ QString quid = usr->text(); ++ QString qpwd = pwd->text(); ++ ++ cstr[ 0 ] = '\0'; ++ ++ if ( qdsn.isEmpty()) ++ strcpy( tmp, "DSN=" ); ++ else if ( qdsn.isNull()) ++ strcpy( tmp, "" ); ++ else ++ sprintf( tmp, "DSN=%s", qdsn.toUtf8().constData()); ++ ++ strcpy( cstr, tmp ); ++ ++ if ( quid.isEmpty()) ++ strcpy( tmp, "UID=" ); ++ else if ( quid.isNull()) ++ strcpy( tmp, "" ); ++ else ++ sprintf( tmp, "UID=%s", quid.toUtf8().constData()); ++ ++ if ( strlen( tmp ) > 0 ) ++ { ++ if ( strlen( cstr ) > 0 ) ++ { ++ strcat( cstr, ";" ); ++ strcat( cstr, tmp ); ++ } ++ else ++ { ++ strcpy( cstr, tmp ); ++ } ++ } ++ ++ if ( qpwd.isEmpty()) ++ strcpy( tmp, "PWD=" ); ++ else if ( qpwd.isNull()) ++ strcpy( tmp, "" ); ++ else ++ sprintf( tmp, "PWD=%s", qpwd.toUtf8().constData()); ++ ++ if ( strlen( tmp ) > 0 ) ++ { ++ if ( strlen( cstr ) > 0 ) ++ { ++ strcat( cstr, ";" ); ++ strcat( cstr, tmp ); ++ } ++ else ++ { ++ strcpy( cstr, tmp ); ++ } ++ } ++ ++ ++ SQLHWND hWnd = NULL; ++ ++#ifdef WIN32 ++ hWnd = (SQLHWND)(this->winId()); ++#else ++ ODBCINSTWND Wnd; ++ ++ strcpy( Wnd.szUI, "odbcinstQ4" ); ++ Wnd.hWnd = this; ++ hWnd = (SQLHWND)(&Wnd); ++#endif ++ ++ ret = SQLDriverConnect( hdbc, hWnd, (SQLCHAR*)cstr, strlen( cstr ), NULL, 0, NULL, SQL_DRIVER_COMPLETE ); ++ ++ pOdbcTest->dumpError( SQL_HANDLE_DBC, hdbc ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLConnect() failed" ); ++ SQLFreeHandle( SQL_HANDLE_DBC, hdbc ); ++ if ( !hand ) ++ { ++ SQLFreeHandle( SQL_HANDLE_ENV, henv ); ++ } ++ return; ++ } ++ ++ /* ++ * allocate a statement handle ++ */ ++ ++ ret = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ); ++ pOdbcTest->dumpError( SQL_HANDLE_DBC, hdbc ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLAllocHandle( SQL_HANDLE_STMT ) failed" ); ++ SQLDisconnect( hdbc ); ++ SQLFreeHandle( SQL_HANDLE_DBC, hdbc ); ++ if ( !hand ) ++ { ++ SQLFreeHandle( SQL_HANDLE_ENV, henv ); ++ } ++ return; ++ } ++ ++ /* ++ * all done, record the handles ++ */ ++ if ( !hand ) ++ { ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_ENV, henv ) ); ++ } ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_DBC, hdbc ) ); ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_STMT, hstmt, pOdbcTest->listHandle ) ); ++ ++ pOdbcTest->out_win->append( "Full Connect Succeeded\n" ); ++} ++ ++dFullConnect::dFullConnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 110,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 190,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 270,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 140, 50, 200, 20 ); ++ ++ OdbcHandle * hand = pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handle = new QLabel( "Envronment Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ dsn = new QLineEdit( this ); ++ dsn->setGeometry( 80, 85, 120, 20 ); ++ ++ l_dsn = new QLabel( "DSN:", this ); ++ l_dsn->setGeometry( 10, 85, 60, 20 ); ++ ++ dsn_list = new QListWidget( this ); ++ dsn_list->setGeometry( 80, 106, 120, 100 ); ++ ++ /* ++ * find a env handle, hand is set above ++ */ ++ ++ SQLHANDLE henv; ++ SQLRETURN ret; ++ SQLCHAR dsn_txt[ 128 ]; ++ ++ /* ++ * allocate a handle if required ++ */ ++ ++ if ( !hand ) ++ { ++ ret = SQLAllocEnv( &henv ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( "SQLAllocHandle fails allocating a environment handle" ); ++ return; ++ } ++ } ++ else ++ { ++ henv = hand->getHandle(); ++ } ++ ++ ret = SQLDataSources( henv, ++ SQL_FETCH_FIRST, ++ dsn_txt, ++ sizeof( dsn_txt ), ++ NULL, ++ NULL, ++ 0, ++ NULL ); ++ ++ while ( SQL_SUCCEEDED( ret )) ++ { ++ dsn_list->addItem( (char *)dsn_txt ); ++ ret = SQLDataSources( henv, ++ SQL_FETCH_NEXT, ++ dsn_txt, ++ sizeof( dsn_txt ), ++ NULL, ++ NULL, ++ 0, ++ NULL ); ++ } ++ ++ /* ++ * remove the temp henv ++ */ ++ ++ if ( !hand ) ++ { ++ SQLFreeEnv( henv ); ++ } ++ ++ usr = new QLineEdit( this ); ++ usr->setGeometry( 80, 215, 120, 20 ); ++ usr->setMaxLength( 32 ); ++ ++ l_usr = new QLabel( "User:", this ); ++ l_usr->setGeometry( 10, 215, 60, 20 ); ++ ++ pwd = new QLineEdit( this ); ++ pwd->setGeometry( 80, 245, 120, 20 ); ++ pwd->setEchoMode( QLineEdit::Password ); ++ pwd->setMaxLength( 32 ); ++ ++ l_pwd = new QLabel( "Password:", this ); ++ l_pwd->setGeometry( 10, 245, 60, 20 ); ++ ++ version = new QGroupBox( "ODBC Version", this ); ++ version->setGeometry( 220, 80, 120, 100 ); ++ ++ ver_2 = new QRadioButton( "ODBC 2", version ); ++ ver_2->setGeometry( 10, 20, 100, 20 ); ++ ++ ver_3 = new QRadioButton( "ODBC 3", version ); ++ ver_3->setGeometry( 10, 45, 100, 20 ); ++ ++ ver_def = new QRadioButton( "Default", version ); ++ ver_def->setGeometry( 10, 70, 100, 20 ); ++ ver_def->setChecked( TRUE ); ++ ++ cursor = new QGroupBox( "ODBC Cursors", this ); ++ cursor->setGeometry( 220, 180, 120, 130 ); ++ ++ cur_ifneeded = new QRadioButton( "Use If Needed", cursor ); ++ cur_ifneeded->setGeometry( 10, 20, 100, 20 ); ++ ++ cur_use = new QRadioButton( "Use ODBC", cursor ); ++ cur_use->setGeometry( 10, 45, 100, 20 ); ++ ++ cur_driver = new QRadioButton( "Use Driver", cursor ); ++ cur_driver->setGeometry( 10, 70, 100, 20 ); ++ ++ cur_default = new QRadioButton( "Default", cursor ); ++ cur_default->setGeometry( 10, 95, 100, 20 ); ++ cur_default->setChecked( TRUE ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( dsn_list, SIGNAL(selected(const QString &)), SLOT(set_dsn( const QString &))); ++} ++ ++dFullConnect::~dFullConnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete dsn; ++ delete l_dsn; ++ delete dsn_list; ++ delete usr; ++ delete l_usr; ++ delete pwd; ++ delete l_pwd; ++ delete ver_2; ++ delete ver_3; ++ delete ver_def; ++ delete version; ++ delete cur_ifneeded; ++ delete cur_use; ++ delete cur_driver; ++ delete cur_default; ++ delete cursor; ++} ++ ++void dGetInfo::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "InfoValuePtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "InfoValuePtr: VALID" ); ++} ++ ++void dGetInfo::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLenPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLenPtr: VALID" ); ++} ++ ++void dGetInfo::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ int index; ++ SQLHANDLE in_handle; ++ SQLINTEGER b_len, info_type; ++ SQLSMALLINT strlen, *strlen_ptr; ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetInfo():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = type->currentIndex(); ++ ++ info_type = info_options[ index ].attr; ++ txt.sprintf( " Info Type: %s=%d (%s)", info_options[ index ].text, ++ info_options[ index ].attr, info_options[ index ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new char[ 300 ]; ++ } ++ else ++ { ++ buf = new char[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " Info Value Ptr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Info Value Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ strlen = -9999; ++ ++ if ( strlen_valid->isChecked()) ++ { ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen; ++ } ++ ++ if ( strlen_ptr ) ++ { ++ txt.sprintf( " Strlen Ptr: %p", strlen_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Strlen Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetInfo( in_handle, ++ info_type, buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( strlen_ptr ) ++ { ++ if ( strlen == -9999 ) ++ { ++ txt.sprintf( " *Strlen Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Strlen Ptr: %d", strlen ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ switch ( info_options[ index ].data_type ) ++ { ++ case SQL_CHAR: ++ txt.sprintf( " *InfoValuePtr = \"%s\"", buf ); ++ pOdbcTest->out_win->append( txt ); ++ break; ++ ++ case SQL_INTEGER: ++ SQLUINTEGER ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ txt.sprintf( " *InfoValuePtr = %d (0x%08X)", ival, ival ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( info_options[ index ].values[ 0 ].text ) ++ { ++ if ( info_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; info_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( info_options[ index ].values[ i ].value & ival ) ++ { ++ txt.sprintf( " %s", ++ info_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; info_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( (SQLUINTEGER)(info_options[ index ].values[ i ].value) == ival ) ++ { ++ txt.sprintf( " %s", ++ info_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ ++ case SQL_SMALLINT: ++ SQLSMALLINT sval; ++ memcpy( &sval, buf, sizeof( sval )); ++ txt.sprintf( " *InfoValuePtr = %d (0x%04X)", sval, sval ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( info_options[ index ].values[ 0 ].text ) ++ { ++ if ( info_options[ index ].is_bitmap ) ++ { ++ int i; ++ ++ for ( i = 0; info_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( info_options[ index ].values[ i ].value & sval ) ++ { ++ txt.sprintf( " %s", ++ info_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ for ( i = 0; info_options[ index ].values[ i ].text; i ++ ) ++ { ++ if ( info_options[ index ].values[ i ].value == sval ) ++ { ++ txt.sprintf( " %s", ++ info_options[ index ].values[ i ].text ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ } ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dGetInfo::dGetInfo( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Connection Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ type = new QComboBox( this ); ++ type->setGeometry( 130, 80, 340, 20 ); ++ ++ pOdbcTest->fill_list_box( info_options, type ); ++ ++ l_type = new QLabel( "Info Type:", this ); ++ l_type->setGeometry( 10, 80, 120, 20 ); ++ ++ target_valid = new QCheckBox( "InfoValuePtr: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLenPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 110, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 110, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dGetInfo::~dGetInfo() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete type; ++ delete l_type; ++ delete target_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dGetFunctions::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "SupportedPtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "SupportedPtr: VALID" ); ++} ++ ++void dGetFunctions::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ int index; ++ SQLHANDLE in_handle = NULL; ++ SQLINTEGER func_type; ++ SQLUSMALLINT single_value, odbc_3_all[ SQL_API_ODBC3_ALL_FUNCTIONS ], odbc_2_all[ 100 ]; ++ SQLUSMALLINT *supported_ptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetFunctions():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = type->currentIndex(); ++ ++ func_type = gf_options[ index ].attr; ++ txt.sprintf( " FunctionId: %s=%d (%s)", gf_options[ index ].text, ++ gf_options[ index ].attr, gf_options[ index ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( target_valid->isChecked()) ++ { ++ supported_ptr = NULL; ++ } ++ else ++ { ++ if ( func_type == SQL_API_ODBC3_ALL_FUNCTIONS ) ++ { ++ supported_ptr = odbc_3_all; ++ } ++ else if ( func_type == SQL_API_ALL_FUNCTIONS ) ++ { ++ supported_ptr = odbc_2_all; ++ } ++ else ++ { ++ supported_ptr = &single_value; ++ } ++ } ++ ++ if ( supported_ptr ) ++ { ++ txt.sprintf( " Supported Ptr: %p", supported_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Supported Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetFunctions( in_handle, ++ func_type, supported_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( func_type == SQL_API_ODBC3_ALL_FUNCTIONS ) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ for ( int i = 0; gf_options[ i ].text; i ++ ) ++ { ++ if ( gf_options[ i ].attr == SQL_API_ODBC3_ALL_FUNCTIONS || ++ gf_options[ i ].attr == SQL_API_ALL_FUNCTIONS ) ++ { ++ continue; ++ } ++ ++ if ( SQL_FUNC_EXISTS( odbc_3_all, gf_options[ i ].attr )) ++ { ++ txt.sprintf( " %s=%d SQL_TRUE", gf_options[ i ].text, ++ gf_options[ i ].attr ); ++ } ++ else ++ { ++ txt.sprintf( " %s=%d SQL_FALSE", gf_options[ i ].text, ++ gf_options[ i ].attr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ else if ( func_type == SQL_API_ALL_FUNCTIONS ) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ for ( int i = 0; gf_options[ i ].text; i ++ ) ++ { ++ if ( gf_options[ i ].attr > 99 || ++ gf_options[ i ].attr == SQL_API_ALL_FUNCTIONS ) ++ { ++ continue; ++ } ++ ++ if ( odbc_2_all[ gf_options[ i ].attr ] ) ++ { ++ txt.sprintf( " %s=%d SQL_TRUE", gf_options[ i ].text, ++ gf_options[ i ].attr ); ++ } ++ else ++ { ++ txt.sprintf( " %s=%d SQL_FALSE", gf_options[ index ].text, ++ gf_options[ index ].attr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ else ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( single_value ) ++ { ++ txt.sprintf( " *SupportedPtr: = SQL_TRUE" ); ++ } ++ else ++ { ++ txt.sprintf( " *SupportedPtr: = SQL_FALSE" ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dGetFunctions::dGetFunctions( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Connection Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ type = new QComboBox( this ); ++ type->setGeometry( 130, 80, 340, 20 ); ++ ++ pOdbcTest->fill_list_box( gf_options, type ); ++ ++ l_type = new QLabel( "FunctionId:", this ); ++ l_type->setGeometry( 10, 80, 120, 20 ); ++ ++ target_valid = new QCheckBox( "SupportedPtr: VALID", this ); ++ target_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++} ++ ++dGetFunctions::~dGetFunctions() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete type; ++ delete l_type; ++ delete target_valid; ++} ++ ++void dNativeSQL::out_str_clkd() ++{ ++ if ( out_str_valid->isChecked() ) ++ out_str_valid->setText( "OutStatementText: SQL_NULL_POINTER" ); ++ else ++ out_str_valid->setText( "OutStatementText: VALID" ); ++} ++ ++void dNativeSQL::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "TextLength2Ptr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "TextLength2Ptr2: VALID" ); ++} ++ ++void dNativeSQL::Ok() ++{ ++ const char *in_string, *string_len; ++ SQLCHAR *conn_str_in; ++ SQLCHAR *out_string; ++ SQLINTEGER in_string_len, con_str_out_max; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle; ++ SQLINTEGER con_str_out, *ptr_con_str_out; ++ QString qstring_len, qin_string; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ qstring_len = str_len->currentText(); ++ string_len = qstring_len.toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLNativeSql():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ qin_string = in_str->currentText(); ++ in_string = qin_string.toUtf8().constData(); ++ ++ if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = NULL; ++ pOdbcTest->out_win->append( " InStatementTxt: " ); ++ } ++ else if ( strcmp( in_string, "" ) == 0 ) ++ { ++ conn_str_in = ( SQLCHAR * ) ""; ++ pOdbcTest->out_win->append( " InStatementTxt: " ); ++ } ++ else if ( strcmp( in_string, "" ) == 0 ) ++ { ++ QString *s = new QString( pOdbcTest->in_win->toPlainText() ); ++ if ( s->isEmpty()) ++ in_string = ""; ++ else if ( s->isNull()) ++ in_string = NULL; ++ else ++ in_string = s->toLatin1(); ++ txt.sprintf( " InStatementTxt: %s", in_string ); ++ pOdbcTest->out_win->append( txt ); ++ conn_str_in = ( SQLCHAR * ) in_string; ++ } ++ else ++ { ++ txt.sprintf( " InStatementTxt: %s", in_string ); ++ conn_str_in = ( SQLCHAR * ) in_string; ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strncmp( string_len, "SQL_NTS", 7 ) == 0 ) ++ { ++ in_string_len = SQL_NTS; ++ txt.sprintf( " TextLength1: SQL_NTS=-3" ); ++ } ++ else ++ { ++ in_string_len = atoi( string_len ); ++ txt.sprintf( " TextLength1: %d", in_string_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out_max = buffer_len ->text().toInt(); ++ ++ if ( out_str_valid->isChecked()) ++ { ++ out_string = ( SQLCHAR * ) NULL; ++ } ++ else if ( con_str_out_max < 300 ) ++ { ++ out_string = new SQLCHAR[ 300 ]; ++ } ++ else ++ { ++ out_string = new SQLCHAR[ con_str_out_max ]; ++ } ++ ++ if ( out_string ) ++ { ++ txt.sprintf( " OutStatementText: %p", out_string ); ++ } ++ else ++ { ++ txt.sprintf( " OutStatementText: NULL_POINTER" ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " Buffer Length %d", con_str_out_max ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked()) ++ { ++ ptr_con_str_out = NULL; ++ txt.sprintf( " TextLength2Ptr: NULL_POINTER" ); ++ } ++ else ++ { ++ ptr_con_str_out = &con_str_out; ++ txt.sprintf( " TextLength2Ptr: %p", ptr_con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ con_str_out = -9999; ++ ++ SQLRETURN ret = SQLNativeSql( in_handle, ++ conn_str_in, ++ in_string_len, ++ out_string, ++ con_str_out_max, ++ ptr_con_str_out ); ++ ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( out_string ) ++ { ++ txt.sprintf( " OutStatementText: %s", out_string ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( ptr_con_str_out ) ++ { ++ if ( con_str_out == -9999 ) ++ { ++ txt.sprintf( " *TextLength2Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *TextLength2Ptr: %d", con_str_out ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dNativeSQL::dNativeSQL( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 290,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 370,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 450,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 15, 150, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handle = new QLabel( "Handle:", this ); ++ l_handle->setGeometry( 10, 15, 80, 20 ); ++ ++ in_str = new QComboBox( this ); ++ in_str->setEditable( true ); ++ in_str->setGeometry( 130, 50, 300, 20 ); ++ l_in_str = new QLabel( "InStatementText:", this ); ++ l_in_str->setGeometry( 10, 50, 90, 20 ); ++ in_str->insertItem( 0, "" ); ++ in_str->insertItem( 1, "" ); ++ in_str->insertItem( 2, "" ); ++ ++ str_len = new QComboBox( this ); ++ str_len->setEditable( true ); ++ str_len->setGeometry( 130, 80, 150, 20 ); ++ l_str_len = new QLabel( "TextLength1:", this ); ++ l_str_len->setGeometry( 10, 80, 90, 20 ); ++ str_len->insertItem( 0, "SQL_NTS=-3" ); ++ str_len->insertItem( 1, "0" ); ++ ++ out_str_valid = new QCheckBox( "OutStatementText: VALID", this ); ++ out_str_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "TextLength2Ptr: VALID", this ); ++ strlen_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 80, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 80, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( out_str_valid, SIGNAL( clicked()), this, SLOT( out_str_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dNativeSQL::~dNativeSQL() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete in_str; ++ delete str_len; ++ delete l_handle; ++ delete l_in_str; ++ delete l_str_len; ++ delete out_str_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dAllocConnect::handle_clkd() ++{ ++ if ( handle_valid->isChecked() ) ++ handle_valid->setText( "phdbc: SQL_NULL_POINTER" ); ++ else ++ handle_valid->setText( "phdbc: VALID" ); ++} ++ ++void dAllocConnect::Ok() ++{ ++ SQLHDBC hdbc, *hdbc_ptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, handles ); ++ SQLHANDLE in_handle; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLAllocConnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Environment Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( handle_valid->isChecked()) ++ { ++ hdbc_ptr = NULL; ++ txt.sprintf( " phdbc: SQL_NULL_HANDLE" ); ++ } ++ else ++ { ++ hdbc_ptr = &hdbc; ++ txt.sprintf( " phdbc: %p", hdbc_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLAllocConnect( in_handle, hdbc_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && hdbc_ptr ) ++ { ++ txt.sprintf( " *phdbc: %p", hdbc ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_DBC, hdbc ) ); ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dAllocConnect::dAllocConnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 50, 200, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 50, 80, 20 ); ++ ++ handle_valid = new QCheckBox( "phdbc: VALID", this ); ++ handle_valid->setGeometry( 10, 80, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( handle_valid, SIGNAL( clicked()), this, SLOT( handle_clkd())); ++} ++ ++dAllocConnect::~dAllocConnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handle_valid; ++ delete handles; ++ delete l_handles; ++} ++ ++void dFreeConnect::Ok() ++{ ++ OdbcHandle *dbc = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( dbc ) ++ in_handle = dbc->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLFreeConnect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " hdbc: %p", in_handle ); ++ else ++ txt.sprintf( " hdbc: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLFreeConnect( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && in_handle ) ++ { ++ pOdbcTest->listHandle.removeAll( dbc ); ++ delete dbc; ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dFreeConnect::dFreeConnect( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 120, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handles = new QLabel( "hdbc:", this ); ++ l_handles->setGeometry( 10, 50, 100, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dFreeConnect::~dFreeConnect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++} ++ ++void OdbcTest::slotBrowseConnect() ++{ ++ dBrowseConnect *dlg = new dBrowseConnect( this, "SQLBrowseConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotConnect() ++{ ++ DlgDbcConnect *dlg = new DlgDbcConnect( this, "SQLConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDriverConnect() ++{ ++ dDriverConnect *dlg = new dDriverConnect( this, "SQLDriverConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDisconnect() ++{ ++ dDisconnect *dlg = new dDisconnect( this, "SQLDisconnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetInfo() ++{ ++ dGetInfo *dlg = new dGetInfo( this, "GetInfo" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetFunctions() ++{ ++ dGetFunctions *dlg = new dGetFunctions( this, "GetFunctions" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotNativeSql() ++{ ++ dNativeSQL *dlg = new dNativeSQL( this, "NativeSql" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFullConnect() ++{ ++ dFullConnect *dlg = new dFullConnect( this, "FullConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFullDisconnect() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotAllocConnect() ++{ ++ dAllocConnect *dlg = new dAllocConnect( this, "AllocConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFreeConnect() ++{ ++ dFreeConnect *dlg = new dFreeConnect( this, "FreeConnect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::getInfoOdbc( SQLHANDLE hdbc ) ++{ ++ attr_options *opt = info_options; ++ ++ if ( !hdbc ) ++ { ++ return; ++ } ++ ++ /* ++ * go through each option, and report ++ */ ++ ++ out_win->append( "SQLGetInfo All" ); ++ ++ while ( opt->text ) ++ { ++ char buf[ 300 ]; ++ SQLSMALLINT str_len; ++ SQLINTEGER info_type; ++ QString txt; ++ ++ info_type = opt->attr; ++ ++ SQLRETURN ret = SQLGetInfo( hdbc, ++ info_type, buf, sizeof( buf ), &str_len ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ switch ( opt->data_type ) ++ { ++ case SQL_CHAR: ++ txt.sprintf( " %s=%d (%s) = \"%s\"", ++ opt->text, opt->attr, opt->version, buf ); ++ out_win->append( txt ); ++ break; ++ ++ case SQL_INTEGER: ++ SQLUINTEGER ival; ++ memcpy( &ival, buf, sizeof( ival )); ++ ++ if ( opt->values[ 0 ].text ) ++ { ++ if ( opt->is_bitmap ) ++ { ++ int i; ++ ++ txt.sprintf( " %s=%d (%s) = 0x%08x", ++ opt->text, opt->attr, opt->version, ival ); ++ out_win->append( txt ); ++ ++ for ( i = 0; opt->values[ i ].text; i ++ ) ++ { ++ if ( opt->values[ i ].value & ival ) ++ { ++ txt.sprintf( " %s", ++ opt->values[ i ].text ); ++ out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ txt.sprintf( " %s=%d (%s) = 0x%08x", ++ opt->text, opt->attr, opt->version, ival ); ++ out_win->append( txt ); ++ ++ for ( i = 0; opt->values[ i ].text; i ++ ) ++ { ++ if ( (SQLUINTEGER)(opt->values[ i ].value) == ival ) ++ { ++ txt.sprintf( " %s", ++ opt->values[ i ].text ); ++ out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ ++ case SQL_SMALLINT: ++ SQLSMALLINT sval; ++ memcpy( &sval, buf, sizeof( sval )); ++ ++ if ( opt->values[ 0 ].text ) ++ { ++ if ( opt->is_bitmap ) ++ { ++ int i; ++ ++ txt.sprintf( " %s=%d (%s) = 0x%04x", ++ opt->text, opt->attr, opt->version, sval ); ++ out_win->append( txt ); ++ ++ for ( i = 0; opt->values[ i ].text; i ++ ) ++ { ++ if ( opt->values[ i ].value & sval ) ++ { ++ txt.sprintf( " %s", ++ opt->values[ i ].text ); ++ out_win->append( txt ); ++ } ++ } ++ } ++ else ++ { ++ int i; ++ ++ txt.sprintf( " %s=%d (%s) = 0x%04x", ++ opt->text, opt->attr, opt->version, sval ); ++ out_win->append( txt ); ++ ++ for ( i = 0; opt->values[ i ].text; i ++ ) ++ { ++ if ( opt->values[ i ].value == sval ) ++ { ++ txt.sprintf( " %s", ++ opt->values[ i ].text ); ++ out_win->append( txt ); ++ } ++ } ++ } ++ } ++ break; ++ } ++ } ++ else ++ { ++ txt.sprintf( " %s=%d (%s) Not Supported", ++ opt->text, opt->attr, opt->version ); ++ out_win->append( txt ); ++ } ++ ++ opt ++; ++ } ++} ++ ++void OdbcTest::slotGetInfoAll() ++{ ++ /* ++ * look for a connection handle ++ */ ++ ++ SQLHANDLE hdbc; ++ int handle_count = 0; ++ ++ { ++ QListIterator i( listHandle ); ++ char txt[ 128 ]; ++ ++ while ( i.hasNext() ) ++ { ++ OdbcHandle *hand = i.next(); ++ if ( hand ) hand->toStr( txt ); ++ if ( hand && hand->getType() == SQL_HANDLE_DBC ) ++ { ++ handle_count ++; ++ hdbc = hand->getHandle(); ++ } ++ } ++ } ++ ++ if ( handle_count == 0 ) ++ { ++ QMessageBox::about( this, "Get Info All", ++ "No connection handles avalable" ); ++ } ++ else if ( handle_count == 1 ) ++ { ++ getInfoOdbc( hdbc ); ++ } ++ else ++ { ++ getInfoOdbc(); ++ } ++} ++ ++void OdbcTest::slotGetFunctionsAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/conn.h b/unixODBC-2.3.7/tests/conn.h +new file mode 100644 +index 0000000..b5f20a3 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/conn.h +@@ -0,0 +1,253 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dDisconnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dDisconnect( OdbcTest *pOdbcTest, QString name ); ++ ~dDisconnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dFullConnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dFullConnect( OdbcTest *pOdbcTest, QString name ); ++ ~dFullConnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLineEdit *dsn, *usr, *pwd; ++ QLabel *l_handle, *l_dsn, *l_usr, *l_pwd; ++ QListWidget *dsn_list; ++ QTextEdit *in_win; ++ QGroupBox *version, *cursor; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QRadioButton *ver_2, *ver_3, *ver_def; ++ QRadioButton *cur_ifneeded, *cur_use, *cur_driver, *cur_default; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void set_dsn( const QString &); ++}; ++ ++class dGetInfo : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetInfo( OdbcTest *pOdbcTest, QString name ); ++ ~dGetInfo(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *type; ++ QLineEdit *buffer_len; ++ QCheckBox *target_valid, *strlen_valid; ++ QLabel *l_handle, *l_type, *l_buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dGetFunctions : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetFunctions( OdbcTest *pOdbcTest, QString name ); ++ ~dGetFunctions(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *type; ++ QCheckBox *target_valid; ++ QLabel *l_handle, *l_type; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void Ok(); ++}; ++ ++class dBrowseConnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dBrowseConnect( OdbcTest *pOdbcTest, QString name ); ++ ~dBrowseConnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *in_str, *str_len; ++ QLineEdit *buffer_len; ++ QCheckBox *out_str_valid, *strlen_valid; ++ QLabel *l_handle, *l_out_str, *l_buffer_len; ++ QLabel *l_str_len, *l_in_str; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void out_str_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dDriverConnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dDriverConnect( OdbcTest *pOdbcTest, QString name ); ++ ~dDriverConnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *in_str, *str_len, *driver_completion; ++ QLineEdit *buffer_len; ++ QCheckBox *out_str_valid, *strlen_valid; ++ QLabel *l_handle, *l_out_str, *l_buffer_len; ++ QLabel *l_str_len, *l_in_str, *l_driver_completion; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void out_str_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dNativeSQL : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dNativeSQL( OdbcTest *pOdbcTest, QString name ); ++ ~dNativeSQL(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *in_str, *str_len; ++ QLineEdit *buffer_len; ++ QCheckBox *out_str_valid, *strlen_valid; ++ QLabel *l_handle, *l_out_str, *l_buffer_len; ++ QLabel *l_str_len, *l_in_str; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void out_str_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dAllocConnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dAllocConnect( OdbcTest *pOdbcTest, QString name ); ++ ~dAllocConnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QTextEdit *in_win; ++ QCheckBox *handle_valid; ++ QComboBox *handles; ++ QLabel *l_handles; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void handle_clkd(); ++}; ++ ++class dFreeConnect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dFreeConnect( OdbcTest *pOdbcTest, QString name ); ++ ~dFreeConnect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QTextEdit *in_win; ++ QComboBox *handles; ++ QLabel *l_handles; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/desc.cpp b/unixODBC-2.3.7/tests/desc.cpp +new file mode 100644 +index 0000000..7f8fbbc +--- /dev/null ++++ b/unixODBC-2.3.7/tests/desc.cpp +@@ -0,0 +1,894 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "desc.h" ++#include "OdbcTest.h" ++ ++static attr_options field_ident_struct[] = ++{ ++ { "SQL_DESC_ALLOC_TYPE", SQL_DESC_ALLOC_TYPE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_USMALLINT, 0, 0 ++ }, ++ { "SQL_DESC_ARRAY_SIZE", SQL_DESC_ARRAY_SIZE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_UINTEGER, 0, 0 ++ }, ++ { "SQL_DESC_ARRAY_STATUS_PTR", SQL_DESC_ARRAY_STATUS_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_POINTER, 0, 0 ++ }, ++ { "SQL_DESC_BIND_OFFSET_PTR", SQL_DESC_BIND_OFFSET_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_POINTER, 0, 0 ++ }, ++ { "SQL_DESC_BIND_TYPE", SQL_DESC_BIND_TYPE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_UINTEGER, 0, 0 ++ }, ++ { "SQL_DESC_COUNT", SQL_DESC_COUNT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_SMALLINT, 0, 0 ++ }, ++ { "SQL_DESC_ROWS_PROCESSED_PTR", SQL_DESC_ROWS_PROCESSED_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_POINTER, 0, 0 ++ }, ++ { "SQL_DESC_AUTO_UNIQUE_VALUE", SQL_DESC_AUTO_UNIQUE_VALUE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_BASE_COLUMN_NAME", SQL_DESC_BASE_COLUMN_NAME, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_BASE_TABLE_NAME", SQL_DESC_BASE_TABLE_NAME, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_CASE_SENSITIVE", SQL_DESC_CASE_SENSITIVE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_CATALOG_NAME", SQL_DESC_CATALOG_NAME, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_CONCISE_TYPE", SQL_DESC_CONCISE_TYPE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_SMALLINT, 0, 0 ++ }, ++ { "SQL_DESC_DATA_PTR", SQL_DESC_DATA_PTR, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_POINTER, 0, 0 ++ }, ++ { "SQL_DESC_DATETIME_INTERVAL_CODE", SQL_DESC_DATETIME_INTERVAL_CODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_IS_SMALLINT, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++void dCopyDesc::Ok() ++{ ++ OdbcHandle *desc1 = pOdbcTest->extract_handle_list( SQL_HANDLE_DESC, handle1 ); ++ SQLHANDLE in_handle1 = SQL_NULL_HANDLE; ++ OdbcHandle *desc2 = pOdbcTest->extract_handle_list( SQL_HANDLE_DESC, handle2 ); ++ SQLHANDLE in_handle2 = SQL_NULL_HANDLE; ++ ++ if ( desc1 ) ++ in_handle1 = desc1->getHandle(); ++ if ( desc2 ) ++ in_handle2 = desc2->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLCopyDesc():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle1 ) ++ txt.sprintf( " Source Handle: %p", in_handle1 ); ++ else ++ txt.sprintf( " Source Handle: SQL_NULL_DESC" ); ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_handle2 ) ++ txt.sprintf( " Destination Handle: %p", in_handle2 ); ++ else ++ txt.sprintf( " Destination Handle: SQL_NULL_DESC" ); ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLCopyDesc( in_handle1, in_handle2 ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dCopyDesc::dCopyDesc( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 130,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 210,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 290,10, 70,25 ); ++ ++ handle1 = new QComboBox( this ); ++ handle1->setGeometry( 160, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DESC, handle1 ); ++ ++ l_handle1 = new QLabel( "Source Handle:", this ); ++ l_handle1->setGeometry( 10, 50, 120, 20 ); ++ ++ handle2 = new QComboBox( this ); ++ handle2->setGeometry( 160, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DESC, handle2 ); ++ ++ l_handle2 = new QLabel( "Destination Handle:", this ); ++ l_handle2->setGeometry( 10, 80, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dCopyDesc::~dCopyDesc() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handle1; ++ delete l_handle1; ++ delete handle2; ++ delete l_handle2; ++} ++ ++void dGetDescField::ptr_clkd() ++{ ++ if ( ptr_valid->isChecked() ) ++ ptr_valid->setText( "ValuePtr: SQL_NULL_POINTER" ); ++ else ++ ptr_valid->setText( "ValuePtr: VALID" ); ++} ++ ++void dGetDescField::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StringLengthPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StringLengthPtr: VALID" ); ++} ++ ++void dGetDescField::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DESC, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT b_len, attribute; ++ SQLINTEGER *strlen_ptr, strlen_val; ++ SQLINTEGER rec_number; ++ SQLPOINTER buf; ++ SQLPOINTER pval; ++ SQLINTEGER ival; ++ SQLSMALLINT sval; ++ SQLUINTEGER uival; ++ SQLUSMALLINT usval; ++ int buf_allocated = 0; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetDescField():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Handle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ rec_number = rec_num->text().toInt(); ++ txt.sprintf( " RecNumber: %d", rec_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ attribute = field_ident_struct[ diag_info->currentIndex() ].attr; ++ txt.sprintf( " FieldIdentifier: %s=%d", ++ field_ident_struct[ diag_info->currentIndex() ].text, ++ field_ident_struct[ diag_info->currentIndex() ].attr ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( ptr_valid->isChecked() ) ++ { ++ buf = NULL; ++ txt.sprintf( " ValuePtr: " ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_POINTER ) ++ { ++ buf = &pval; ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_INTEGER ) ++ { ++ buf = &ival; ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_UINTEGER ) ++ { ++ buf = &uival; ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_SMALLINT ) ++ { ++ buf = &sval; ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_USMALLINT ) ++ { ++ buf = &usval; ++ } ++ else ++ { ++ if ( b_len < 0 ) ++ b_len = 300; ++ ++ buf = malloc( b_len ); ++ ++ buf_allocated = 1; ++ ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " ValuePtr: %p", buf ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked() ) ++ { ++ txt.sprintf( " StringLengthPtr: " ); ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_val; ++ strlen_val = -9999; ++ txt.sprintf( " StringLengthPtr: %p", strlen_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLGetDescField( in_handle, rec_number, ++ attribute, buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( buf ) ++ { ++ if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_CHAR ) ++ { ++ txt.sprintf( " ValuePtr: %p", buf ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_POINTER ) ++ { ++ txt.sprintf( " ValuePtr: %p", pval ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_INTEGER ) ++ { ++ txt.sprintf( " ValuePtr: %d", ival ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_UINTEGER ) ++ { ++ txt.sprintf( " ValuePtr: %d", ival ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_SMALLINT ) ++ { ++ txt.sprintf( " ValuePtr: %d", sval ); ++ } ++ else if ( field_ident_struct[ diag_info->currentIndex() ].data_type == SQL_IS_USMALLINT ) ++ { ++ txt.sprintf( " ValuePtr: %d", sval ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strlen_ptr ) ++ { ++ if ( strlen_val == -9999 ) ++ { ++ txt.sprintf( " *StringLengthPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *StringLengthPtr: %d", strlen_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf && buf_allocated ) ++ free( buf ); ++} ++ ++dGetDescField::dGetDescField( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 250,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 330,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 410,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DESC, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 50, 120, 20 ); ++ ++ rec_num = new QLineEdit( this ); ++ rec_num->setGeometry( 130, 80, 70, 20 ); ++ rec_num->setMaxLength( 6 ); ++ rec_num->setText( "0" ); ++ ++ l_rec_num = new QLabel( "Rec Number:", this ); ++ l_rec_num->setGeometry( 10, 80, 100, 20 ); ++ ++ diag_info = new QComboBox( this ); ++ diag_info->setGeometry( 130, 110, 350, 20 ); ++ pOdbcTest->fill_list_box( field_ident_struct, diag_info ); ++ ++ l_diag_info = new QLabel( "Field Identifier:", this ); ++ l_diag_info->setGeometry( 10, 110, 120, 20 ); ++ ++ ptr_valid = new QCheckBox( "ValuePtr: VALID", this ); ++ ptr_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 130, 170, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Length:", this ); ++ l_buffer_len->setGeometry( 10, 170, 100, 20 ); ++ ++ strlen_valid = new QCheckBox( "StringLengthPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ connect( ptr_valid, SIGNAL( clicked()), this, SLOT( ptr_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dGetDescField::~dGetDescField() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete ptr_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++ delete rec_num; ++ delete l_rec_num; ++ delete l_diag_info; ++ delete diag_info; ++} ++ ++void dGetDescRec::name_clkd() ++{ ++ if ( name_valid->isChecked() ) ++ name_valid->setText( "Name: SQL_NULL_POINTER" ); ++ else ++ name_valid->setText( "Name: VALID" ); ++} ++ ++void dGetDescRec::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StringLengthPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StringLengthPtr: VALID" ); ++} ++ ++void dGetDescRec::type_clkd() ++{ ++ if ( type_valid->isChecked() ) ++ type_valid->setText( "TypePtr: SQL_NULL_POINTER" ); ++ else ++ type_valid->setText( "TypePtr: VALID" ); ++} ++ ++void dGetDescRec::sub_type_clkd() ++{ ++ if ( sub_type_valid->isChecked() ) ++ sub_type_valid->setText( "SubTypePtr: SQL_NULL_POINTER" ); ++ else ++ sub_type_valid->setText( "SubTypePtr: VALID" ); ++} ++ ++void dGetDescRec::length_clkd() ++{ ++ if ( length_valid->isChecked() ) ++ length_valid->setText( "LengthPtr: SQL_NULL_POINTER" ); ++ else ++ length_valid->setText( "LengthPtr: VALID" ); ++} ++ ++void dGetDescRec::precision_clkd() ++{ ++ if ( precision_valid->isChecked() ) ++ precision_valid->setText( "PrecisionPtr: SQL_NULL_POINTER" ); ++ else ++ precision_valid->setText( "PrecisionPtr: VALID" ); ++} ++ ++void dGetDescRec::scale_clkd() ++{ ++ if ( scale_valid->isChecked() ) ++ scale_valid->setText( "ScalePtr: SQL_NULL_POINTER" ); ++ else ++ scale_valid->setText( "ScalePtr: VALID" ); ++} ++ ++void dGetDescRec::nullable_clkd() ++{ ++ if ( nullable_valid->isChecked() ) ++ nullable_valid->setText( "NullablePtr: SQL_NULL_POINTER" ); ++ else ++ nullable_valid->setText( "NullablePtr: VALID" ); ++} ++ ++void dGetDescRec::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DESC, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT b_len; ++ SQLSMALLINT *strlen_ptr, strlen_val; ++ SQLSMALLINT rec_number; ++ SQLSMALLINT *type_ptr, type_val; ++ SQLSMALLINT *sub_type_ptr, sub_type_val; ++ SQLLEN *length_ptr, length_val; ++ SQLSMALLINT *precision_ptr, precision_val; ++ SQLSMALLINT *scale_ptr, scale_val; ++ SQLSMALLINT *nullable_ptr, nullable_val; ++ SQLCHAR *buf; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetDescRec():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Handle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ rec_number = rec_num->text().toInt(); ++ txt.sprintf( " RecNumber: %d", rec_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( name_valid->isChecked() ) ++ { ++ buf = NULL; ++ txt.sprintf( " Name: " ); ++ } ++ else ++ { ++ if ( b_len < 0 ) ++ b_len = 300; ++ ++ buf = new SQLCHAR[ b_len ]; ++ txt.sprintf( " Name: %p", buf ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked() ) ++ { ++ txt.sprintf( " StringLengthPtr: " ); ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_val; ++ strlen_val = -9999; ++ txt.sprintf( " StringLengthPtr: %p", strlen_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( type_valid->isChecked() ) ++ { ++ txt.sprintf( " TypePtr: " ); ++ type_ptr = NULL; ++ } ++ else ++ { ++ type_ptr = &type_val; ++ type_val = -9999; ++ txt.sprintf( " TypePtr: %p", type_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( sub_type_valid->isChecked() ) ++ { ++ txt.sprintf( " SubTypePtr: " ); ++ sub_type_ptr = NULL; ++ } ++ else ++ { ++ sub_type_ptr = &sub_type_val; ++ sub_type_val = -9999; ++ txt.sprintf( " SubTypePtr: %p", sub_type_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( length_valid->isChecked() ) ++ { ++ txt.sprintf( " LengthPtr: " ); ++ length_ptr = NULL; ++ } ++ else ++ { ++ length_ptr = &length_val; ++ length_val = -9999; ++ txt.sprintf( " LengthPtr: %p", length_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( precision_valid->isChecked() ) ++ { ++ txt.sprintf( " PrecisionPtr: " ); ++ precision_ptr = NULL; ++ } ++ else ++ { ++ precision_ptr = &precision_val; ++ precision_val = -9999; ++ txt.sprintf( " PrecisionPtr: %p", precision_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( scale_valid->isChecked() ) ++ { ++ txt.sprintf( " ScalePtr: " ); ++ scale_ptr = NULL; ++ } ++ else ++ { ++ scale_ptr = &scale_val; ++ scale_val = -9999; ++ txt.sprintf( " ScalePtr: %p", scale_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( nullable_valid->isChecked() ) ++ { ++ txt.sprintf( " NullablePtr: " ); ++ nullable_ptr = NULL; ++ } ++ else ++ { ++ nullable_ptr = &nullable_val; ++ nullable_val = -9999; ++ txt.sprintf( " NullablePtr: %p", nullable_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLGetDescRec( in_handle, rec_number, ++ buf, b_len, strlen_ptr, ++ type_ptr, ++ sub_type_ptr, ++ length_ptr, ++ precision_ptr, ++ scale_ptr, ++ nullable_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( buf ) ++ { ++ txt.sprintf( " Name: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( strlen_ptr ) ++ { ++ if ( strlen_val == -9999 ) ++ { ++ txt.sprintf( " *StringLengthPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *StringLengthPtr: %d", strlen_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( type_ptr ) ++ { ++ if ( type_val == -9999 ) ++ { ++ txt.sprintf( " *TypePtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *TypePtr: %d", type_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( sub_type_ptr ) ++ { ++ if ( sub_type_val == -9999 ) ++ { ++ txt.sprintf( " *SubTypePtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *SubTypePtr: %d", sub_type_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( length_ptr ) ++ { ++ if ( length_val == -9999 ) ++ { ++ txt.sprintf( " *LengthPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *LengthPtr: %d", length_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( precision_ptr ) ++ { ++ if ( precision_val == -9999 ) ++ { ++ txt.sprintf( " *PrecisionPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *PrecisionPtr: %d", precision_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( nullable_ptr ) ++ { ++ if ( nullable_val == -9999 ) ++ { ++ txt.sprintf( " *NullablePtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NullablePtr: %d", nullable_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ delete buf; ++} ++ ++dGetDescRec::dGetDescRec( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 250,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 330,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 410,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DESC, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 50, 120, 20 ); ++ ++ rec_num = new QLineEdit( this ); ++ rec_num->setGeometry( 130, 80, 70, 20 ); ++ rec_num->setMaxLength( 6 ); ++ rec_num->setText( "0" ); ++ ++ l_rec_num = new QLabel( "Rec Number:", this ); ++ l_rec_num->setGeometry( 10, 80, 100, 20 ); ++ ++ name_valid = new QCheckBox( "Name: VALID", this ); ++ name_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 130, 140, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Length:", this ); ++ l_buffer_len->setGeometry( 10, 140, 100, 20 ); ++ ++ strlen_valid = new QCheckBox( "StringLengthPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 170, 220, 15 ); ++ ++ type_valid = new QCheckBox( "TypePtr: VALID", this ); ++ type_valid->setGeometry( 300, 170, 220, 15 ); ++ ++ sub_type_valid = new QCheckBox( "SubTypePtr: VALID", this ); ++ sub_type_valid->setGeometry( 10, 200, 220, 15 ); ++ ++ length_valid = new QCheckBox( "LengthPtr: VALID", this ); ++ length_valid->setGeometry( 300, 200, 220, 15 ); ++ ++ precision_valid = new QCheckBox( "PrecisionPtr: VALID", this ); ++ precision_valid->setGeometry( 10, 230, 220, 15 ); ++ ++ scale_valid = new QCheckBox( "ScalePtr: VALID", this ); ++ scale_valid->setGeometry( 300, 230, 220, 15 ); ++ ++ nullable_valid = new QCheckBox( "NullablePtr: VALID", this ); ++ nullable_valid->setGeometry( 10, 260, 220, 15 ); ++ ++ connect( name_valid, SIGNAL( clicked()), this, SLOT( name_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++ connect( type_valid, SIGNAL( clicked()), this, SLOT( type_clkd())); ++ connect( sub_type_valid, SIGNAL( clicked()), this, SLOT( sub_type_clkd())); ++ connect( length_valid, SIGNAL( clicked()), this, SLOT( length_clkd())); ++ connect( scale_valid, SIGNAL( clicked()), this, SLOT( scale_clkd())); ++ connect( precision_valid, SIGNAL( clicked()), this, SLOT( precision_clkd())); ++ connect( nullable_valid, SIGNAL( clicked()), this, SLOT( nullable_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dGetDescRec::~dGetDescRec() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete name_valid; ++ delete strlen_valid; ++ delete type_valid; ++ delete sub_type_valid; ++ delete length_valid; ++ delete precision_valid; ++ delete nullable_valid; ++ delete scale_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++ delete rec_num; ++ delete l_rec_num; ++} ++ ++void OdbcTest::slotCopyDesc() ++{ ++ dCopyDesc *dlg = new dCopyDesc( this, "SQLCopyDesc" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetDescField() ++{ ++ dGetDescField *dlg = new dGetDescField( this, "SQLGetDescField" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetDescRec() ++{ ++ dGetDescRec *dlg = new dGetDescRec( this, "SQLGetDescRec" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetDescField() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotSetDescRec() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotGetDescAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/desc.h b/unixODBC-2.3.7/tests/desc.h +new file mode 100644 +index 0000000..b2a4930 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/desc.h +@@ -0,0 +1,113 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dCopyDesc : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dCopyDesc( OdbcTest *pOdbcTest, QString name ); ++ ~dCopyDesc(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handle1, *handle2; ++ QLabel *l_handle1, *l_handle2; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dGetDescField : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetDescField( OdbcTest *pOdbcTest, QString name ); ++ ~dGetDescField(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *diag_info; ++ QLabel *l_handle_type, *l_handles, *l_buffer_len, *l_rec_num, *l_diag_info; ++ QCheckBox *ptr_valid, *strlen_valid; ++ QLineEdit *buffer_len, *rec_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void ptr_clkd(); ++ void strlen_clkd(); ++}; ++ ++class dGetDescRec : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetDescRec( OdbcTest *pOdbcTest, QString name ); ++ ~dGetDescRec(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle_type, *l_handles, *l_buffer_len, *l_rec_num; ++ QCheckBox *name_valid, *strlen_valid, *type_valid, *sub_type_valid; ++ QCheckBox *length_valid, *precision_valid, *scale_valid, *nullable_valid; ++ QLineEdit *buffer_len, *rec_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void name_clkd(); ++ void strlen_clkd(); ++ void type_clkd(); ++ void sub_type_clkd(); ++ void length_clkd(); ++ void precision_clkd(); ++ void scale_clkd(); ++ void nullable_clkd(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/diag.cpp b/unixODBC-2.3.7/tests/diag.cpp +new file mode 100644 +index 0000000..847973f +--- /dev/null ++++ b/unixODBC-2.3.7/tests/diag.cpp +@@ -0,0 +1,931 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "diag.h" ++#include "OdbcTest.h" ++ ++static attr_value handle_type_struct[] = ++{ ++ { "SQL_HANDLE_ENV", SQL_HANDLE_ENV, NULL, 0}, ++ { "SQL_HANDLE_DBC", SQL_HANDLE_DBC, NULL, 0}, ++ { "SQL_HANDLE_STMT", SQL_HANDLE_STMT, NULL, 0}, ++ { "SQL_HANDLE_DESC", SQL_HANDLE_DESC, NULL, 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_options field_type_struct[] = ++{ ++ { "SQL_DIAG_CURSOR_ROW_COUNT", SQL_DIAG_CURSOR_ROW_COUNT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_DYNAMIC_FUNCTION", SQL_DIAG_DYNAMIC_FUNCTION, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_DYNAMIC_FUNCTION_CODE", SQL_DIAG_DYNAMIC_FUNCTION_CODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_NUMBER", SQL_DIAG_NUMBER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_RETURNCODE", SQL_DIAG_RETURNCODE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_ROW_COUNT", SQL_DIAG_ROW_COUNT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_CLASS_ORIGIN", SQL_DIAG_CLASS_ORIGIN, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_COLUMN_NUMBER", SQL_DIAG_COLUMN_NUMBER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_CONNECTION_NAME", SQL_DIAG_CONNECTION_NAME, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_MESSAGE_TEXT", SQL_DIAG_MESSAGE_TEXT, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_NATIVE", SQL_DIAG_NATIVE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_ROW_NUMBER", SQL_DIAG_ROW_NUMBER, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DIAG_SERVER_NAME", SQL_DIAG_SERVER_NAME, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_SQLSTATE", SQL_DIAG_SQLSTATE, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DIAG_SUBCLASS_ORIGIN", SQL_DIAG_SUBCLASS_ORIGIN, ++ { ++ { NULL, 0, NULL, 0 } ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0 } }, NULL, 0, 0, 0 } ++}; ++ ++void dError::sqlstate_clkd() ++{ ++ if ( sqlstate_valid->isChecked() ) ++ sqlstate_valid->setText( "szSqlState: SQL_NULL_POINTER" ); ++ else ++ sqlstate_valid->setText( "szSqlState: VALID" ); ++} ++ ++void dError::native_clkd() ++{ ++ if ( native_valid->isChecked() ) ++ native_valid->setText( "pfNativeError: SQL_NULL_POINTER" ); ++ else ++ native_valid->setText( "pfNativeError: VALID" ); ++} ++ ++void dError::error_clkd() ++{ ++ if ( error_valid->isChecked() ) ++ error_valid->setText( "szErrorMsg: SQL_NULL_POINTER" ); ++ else ++ error_valid->setText( "szErrorMsg: VALID" ); ++} ++ ++void dError::perror_clkd() ++{ ++ if ( perror_valid->isChecked() ) ++ perror_valid->setText( "pcbErrorMsg: SQL_NULL_POINTER" ); ++ else ++ perror_valid->setText( "pcbErrorMsg: VALID" ); ++} ++ ++void dError::Ok() ++{ ++ OdbcHandle *stmt = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, shandles ); ++ OdbcHandle *dbc = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, chandles ); ++ OdbcHandle *env = pOdbcTest->extract_handle_list( SQL_HANDLE_ENV, ehandles ); ++ SQLHANDLE in_shandle = SQL_NULL_HANDLE; ++ SQLHANDLE in_dhandle = SQL_NULL_HANDLE; ++ SQLHANDLE in_ehandle = SQL_NULL_HANDLE; ++ SQLCHAR sqlstate[ 7 ], *psqlstate; ++ SQLSMALLINT b_len, text_len, *ptext_len; ++ SQLINTEGER native, *pnative; ++ SQLCHAR *buf; ++ ++ if ( env ) ++ in_ehandle = env->getHandle(); ++ if ( dbc ) ++ in_dhandle = dbc->getHandle(); ++ if ( stmt ) ++ in_shandle = stmt->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLError():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_ehandle ) ++ txt.sprintf( " Environment Handle: %p", in_ehandle ); ++ else ++ txt.sprintf( " Environment Handle: SQL_NULL_HENV" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_dhandle ) ++ txt.sprintf( " Connection Handle: %p", in_dhandle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_shandle ) ++ txt.sprintf( " Statement Handle: %p", in_shandle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( sqlstate_valid->isChecked() ) ++ { ++ txt.sprintf( " szSqlState: " ); ++ psqlstate = NULL; ++ } ++ else ++ { ++ psqlstate = sqlstate; ++ strcpy(( char * ) sqlstate, "XYXYXZ" ); ++ txt.sprintf( " szSqlState: %p", psqlstate ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( native_valid->isChecked() ) ++ { ++ txt.sprintf( " pfNativeError: " ); ++ pnative = NULL; ++ } ++ else ++ { ++ pnative = &native; ++ native = -999999; ++ txt.sprintf( " pfNativeError: %p", pnative ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( error_valid->isChecked() ) ++ { ++ buf = NULL; ++ txt.sprintf( " szErrorMsg: " ); ++ } ++ else ++ { ++ if ( b_len < 0 ) ++ b_len = 300; ++ ++ buf = new SQLCHAR[ b_len ]; ++ ++ txt.sprintf( " szErrorMsg: %p", buf ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " cbErrorMsgMax: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( perror_valid->isChecked() ) ++ { ++ txt.sprintf( " pcbErrorMsg: " ); ++ ptext_len = NULL; ++ } ++ else ++ { ++ ptext_len = &text_len; ++ text_len = -9999; ++ txt.sprintf( " pcbErrorMsg: %p", ptext_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLError( in_ehandle, in_dhandle, in_shandle, ++ psqlstate, pnative, buf, b_len, ptext_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( psqlstate ) ++ { ++ if ( strcmp(( char * ) sqlstate, "XYXYXZ" ) == 0 ) ++ { ++ txt.sprintf( " *szSqlState: " ); ++ } ++ else ++ { ++ txt.sprintf( " *szSqlState: %6s", sqlstate ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( pnative ) ++ { ++ if ( native == -999999 ) ++ { ++ txt.sprintf( " *pfNativeError: " ); ++ } ++ else ++ { ++ txt.sprintf( " *pfNativeError: %d", native ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( buf ) ++ { ++ txt.sprintf( " *szErrorMsg: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( ptext_len ) ++ { ++ if ( text_len == -9999 ) ++ { ++ txt.sprintf( " *pcbErrorMsg: " ); ++ } ++ else ++ { ++ txt.sprintf( " *pcbErrorMsg: %d", text_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ delete buf; ++} ++ ++dError::dError( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ ehandles = new QComboBox( this ); ++ ehandles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, ehandles ); ++ ++ l_ehandle = new QLabel( "Environment Handle:", this ); ++ l_ehandle->setGeometry( 10, 50, 120, 20 ); ++ ++ chandles = new QComboBox( this ); ++ chandles->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, chandles ); ++ ++ l_chandle = new QLabel( "Connection Handle:", this ); ++ l_chandle->setGeometry( 10, 80, 120, 20 ); ++ ++ shandles = new QComboBox( this ); ++ shandles->setGeometry( 130, 110, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, shandles ); ++ ++ l_shandle = new QLabel( "Statement Handle:", this ); ++ l_shandle->setGeometry( 10, 110, 120, 20 ); ++ ++ sqlstate_valid = new QCheckBox( "szSqlState: VALID", this ); ++ sqlstate_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ native_valid = new QCheckBox( "pfNativeError: VALID", this ); ++ native_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ error_valid = new QCheckBox( "szErrorMsg: VALID", this ); ++ error_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 350, 200, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "cbErrorMsgMax:", this ); ++ l_buffer_len->setGeometry( 240, 200, 100, 20 ); ++ ++ perror_valid = new QCheckBox( "pcbErrorMsg: VALID", this ); ++ perror_valid->setGeometry( 10, 230, 300, 15 ); ++ ++ connect( native_valid, SIGNAL( clicked()), this, SLOT( native_clkd())); ++ connect( sqlstate_valid, SIGNAL( clicked()), this, SLOT( sqlstate_clkd())); ++ connect( error_valid, SIGNAL( clicked()), this, SLOT( error_clkd())); ++ connect( perror_valid, SIGNAL( clicked()), this, SLOT( perror_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dError::~dError() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete ehandles; ++ delete chandles; ++ delete shandles; ++ delete l_ehandle; ++ delete l_chandle; ++ delete l_shandle; ++ delete sqlstate_valid; ++ delete native_valid; ++ delete error_valid; ++ delete perror_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dGetDiagRec::sel_handle( int /* index */ ) ++{ ++ int handle_t; ++ ++ handles->clear(); ++ handle_t = handle_type_struct[ handle_type->currentIndex() ].value; ++ ++ pOdbcTest->fill_handle_list( handle_t, handles ); ++} ++ ++void dGetDiagRec::sqlstate_clkd() ++{ ++ if ( sqlstate_valid->isChecked() ) ++ sqlstate_valid->setText( "szSqlState: SQL_NULL_POINTER" ); ++ else ++ sqlstate_valid->setText( "szSqlState: VALID" ); ++} ++ ++void dGetDiagRec::native_clkd() ++{ ++ if ( native_valid->isChecked() ) ++ native_valid->setText( "pfNativeError: SQL_NULL_POINTER" ); ++ else ++ native_valid->setText( "pfNativeError: VALID" ); ++} ++ ++void dGetDiagRec::error_clkd() ++{ ++ if ( error_valid->isChecked() ) ++ error_valid->setText( "szErrorMsg: SQL_NULL_POINTER" ); ++ else ++ error_valid->setText( "szErrorMsg: VALID" ); ++} ++ ++void dGetDiagRec::perror_clkd() ++{ ++ if ( perror_valid->isChecked() ) ++ perror_valid->setText( "pcbErrorMsg: SQL_NULL_POINTER" ); ++ else ++ perror_valid->setText( "pcbErrorMsg: VALID" ); ++} ++ ++void dGetDiagRec::Ok() ++{ ++ int htype = handle_type_struct[ handle_type->currentIndex() ].value; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( htype, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLCHAR sqlstate[ 7 ], *psqlstate; ++ SQLSMALLINT b_len, text_len, *ptext_len; ++ SQLINTEGER native, *pnative, rec_number; ++ SQLCHAR *buf; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetDiagRec():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ txt.sprintf( " Handle Type: %s", handle_type_struct[ handle_type->currentIndex() ].text ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Handle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ rec_number = rec_num->text().toInt(); ++ txt.sprintf( " RecNumber: %d", rec_number ); ++ ++ if ( sqlstate_valid->isChecked() ) ++ { ++ txt.sprintf( " szSqlState: " ); ++ psqlstate = NULL; ++ } ++ else ++ { ++ psqlstate = sqlstate; ++ strcpy(( char * ) sqlstate, "XYXYXZ" ); ++ txt.sprintf( " szSqlState: %p", psqlstate ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( native_valid->isChecked() ) ++ { ++ txt.sprintf( " pfNativeError: " ); ++ pnative = NULL; ++ } ++ else ++ { ++ pnative = &native; ++ native = -999999; ++ txt.sprintf( " pfNativeError: %p", pnative ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( error_valid->isChecked() ) ++ { ++ buf = NULL; ++ txt.sprintf( " szErrorMsg: " ); ++ } ++ else ++ { ++ if ( b_len < 0 ) ++ b_len = 300; ++ ++ buf = new SQLCHAR[ b_len ]; ++ ++ txt.sprintf( " szErrorMsg: %p", buf ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ txt.sprintf( " cbErrorMsgMax: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( perror_valid->isChecked() ) ++ { ++ txt.sprintf( " pcbErrorMsg: " ); ++ ptext_len = NULL; ++ } ++ else ++ { ++ ptext_len = &text_len; ++ text_len = -9999; ++ txt.sprintf( " pcbErrorMsg: %p", ptext_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLGetDiagRec( htype, in_handle, rec_number, ++ psqlstate, pnative, buf, b_len, ptext_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( psqlstate ) ++ { ++ if ( strcmp(( char * ) sqlstate, "XYXYXZ" ) == 0 ) ++ { ++ txt.sprintf( " *szSqlState: " ); ++ } ++ else ++ { ++ txt.sprintf( " *szSqlState: %6s", sqlstate ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( pnative ) ++ { ++ if ( native == -999999 ) ++ { ++ txt.sprintf( " *pfNativeError: " ); ++ } ++ else ++ { ++ txt.sprintf( " *pfNativeError: %d", native ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( buf ) ++ { ++ txt.sprintf( " *szErrorMsg: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( ptext_len ) ++ { ++ if ( text_len == -9999 ) ++ { ++ txt.sprintf( " *pcbErrorMsg: " ); ++ } ++ else ++ { ++ txt.sprintf( " *pcbErrorMsg: %d", text_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ delete buf; ++} ++ ++dGetDiagRec::dGetDiagRec( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handle_type = new QComboBox( this ); ++ handle_type->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_list_box( handle_type_struct, handle_type ); ++ ++ l_handle_type = new QLabel( "Handle Type:", this ); ++ l_handle_type->setGeometry( 10, 50, 120, 20 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 80, 120, 20 ); ++ ++ rec_num = new QLineEdit( this ); ++ rec_num->setGeometry( 130, 110, 70, 20 ); ++ rec_num->setMaxLength( 6 ); ++ rec_num->setText( "1" ); ++ ++ l_rec_num = new QLabel( "Rec Number:", this ); ++ l_rec_num->setGeometry( 10, 110, 100, 20 ); ++ ++ sqlstate_valid = new QCheckBox( "szSqlState: VALID", this ); ++ sqlstate_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ native_valid = new QCheckBox( "pfNativeError: VALID", this ); ++ native_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ error_valid = new QCheckBox( "szErrorMsg: VALID", this ); ++ error_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 350, 200, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "cbErrorMsgMax:", this ); ++ l_buffer_len->setGeometry( 240, 200, 100, 20 ); ++ ++ perror_valid = new QCheckBox( "pcbErrorMsg: VALID", this ); ++ perror_valid->setGeometry( 10, 230, 300, 15 ); ++ ++ connect( native_valid, SIGNAL( clicked()), this, SLOT( native_clkd())); ++ connect( sqlstate_valid, SIGNAL( clicked()), this, SLOT( sqlstate_clkd())); ++ connect( error_valid, SIGNAL( clicked()), this, SLOT( error_clkd())); ++ connect( perror_valid, SIGNAL( clicked()), this, SLOT( perror_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( handle_type, SIGNAL(activated(int)), this, SLOT( sel_handle(int))); ++} ++ ++dGetDiagRec::~dGetDiagRec() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete handle_type; ++ delete l_handle_type; ++ delete sqlstate_valid; ++ delete native_valid; ++ delete error_valid; ++ delete perror_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++ delete rec_num; ++ delete l_rec_num; ++} ++ ++void dGetDiagField::sel_handle( int /* index */ ) ++{ ++ int handle_t; ++ ++ handles->clear(); ++ handle_t = handle_type_struct[ handle_type->currentIndex() ].value; ++ ++ pOdbcTest->fill_handle_list( handle_t, handles ); ++} ++ ++void dGetDiagField::diag_ptr_clkd() ++{ ++ if ( diag_ptr_valid->isChecked() ) ++ diag_ptr_valid->setText( "DiagInfoPtr: SQL_NULL_POINTER" ); ++ else ++ diag_ptr_valid->setText( "DiagInfoPtr: VALID" ); ++} ++ ++void dGetDiagField::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StringLengthPtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StringLengthPtr: VALID" ); ++} ++ ++void dGetDiagField::Ok() ++{ ++ int htype = handle_type_struct[ handle_type->currentIndex() ].value; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( htype, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT b_len, *strlen_ptr, strlen_val, attribute; ++ SQLINTEGER rec_number; ++ SQLCHAR *buf; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetDiagField():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ txt.sprintf( " Handle Type: %s", handle_type_struct[ handle_type->currentIndex() ].text ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Handle: SQL_NULL_HANDLE" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ rec_number = rec_num->text().toInt(); ++ txt.sprintf( " RecNumber: %d", rec_number ); ++ ++ attribute = field_type_struct[ diag_info->currentIndex() ].attr; ++ txt.sprintf( " DiagIdentifier: %s=%d", ++ field_type_struct[ diag_info->currentIndex() ].text, ++ field_type_struct[ diag_info->currentIndex() ].attr ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( diag_ptr_valid->isChecked() ) ++ { ++ buf = NULL; ++ txt.sprintf( " DiagInfo: " ); ++ } ++ else ++ { ++ if ( b_len < 0 ) ++ b_len = 300; ++ ++ buf = new SQLCHAR[ b_len ]; ++ ++ txt.sprintf( " DiagInfo: %p", buf ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked() ) ++ { ++ txt.sprintf( " StringLengthPtr: " ); ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_val; ++ strlen_val = -9999; ++ txt.sprintf( " StringLengthPtr: %p", strlen_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLGetDiagField( htype, in_handle, rec_number, ++ attribute, buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( field_type_struct[ diag_info->currentIndex() ].data_type == SQL_INTEGER ) ++ { ++ if ( buf ) ++ { ++ int lval; ++ ++ memcpy( &lval, buf, sizeof( lval )); ++ txt.sprintf( " *DiagInfo: %d", lval ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ else ++ { ++ if ( buf ) ++ { ++ txt.sprintf( " *DiagInfo: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ if ( strlen_ptr ) ++ { ++ if ( strlen_val == -9999 ) ++ { ++ txt.sprintf( " *StringLengthPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *StringLengthPtr: %d", strlen_val ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ delete buf; ++} ++ ++dGetDiagField::dGetDiagField( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 250,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 330,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 410,10, 70,25 ); ++ ++ handle_type = new QComboBox( this ); ++ handle_type->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_list_box( handle_type_struct, handle_type ); ++ ++ l_handle_type = new QLabel( "Handle Type:", this ); ++ l_handle_type->setGeometry( 10, 50, 120, 20 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 80, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_ENV, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 80, 120, 20 ); ++ ++ rec_num = new QLineEdit( this ); ++ rec_num->setGeometry( 130, 110, 70, 20 ); ++ rec_num->setMaxLength( 6 ); ++ rec_num->setText( "1" ); ++ ++ l_rec_num = new QLabel( "Rec Number:", this ); ++ l_rec_num->setGeometry( 10, 110, 100, 20 ); ++ ++ diag_info = new QComboBox( this ); ++ diag_info->setGeometry( 130, 140, 350, 20 ); ++ pOdbcTest->fill_list_box( field_type_struct, diag_info ); ++ ++ l_diag_info = new QLabel( "Diag Identifier::", this ); ++ l_diag_info->setGeometry( 10, 140, 120, 20 ); ++ ++ diag_ptr_valid = new QCheckBox( "DiagInfoPtr: VALID", this ); ++ diag_ptr_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 130, 200, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Length:", this ); ++ l_buffer_len->setGeometry( 10, 200, 100, 20 ); ++ ++ strlen_valid = new QCheckBox( "pcbErrorMsg: VALID", this ); ++ strlen_valid->setGeometry( 10, 230, 300, 15 ); ++ ++ connect( diag_ptr_valid, SIGNAL( clicked()), this, SLOT( diag_ptr_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( handle_type, SIGNAL(activated(int)), this, SLOT( sel_handle(int))); ++} ++ ++dGetDiagField::~dGetDiagField() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete handle_type; ++ delete l_handle_type; ++ delete diag_ptr_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++ delete rec_num; ++ delete l_rec_num; ++} ++ ++void OdbcTest::slotGetDiagRec() ++{ ++ dGetDiagRec *dlg = new dGetDiagRec( this, "SQLGetDiagRec" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetDiagField() ++{ ++ dGetDiagField *dlg = new dGetDiagField( this, "SQLGetDiagField" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotError() ++{ ++ dError *dlg = new dError( this, "SQLError" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotErrorsAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/diag.h b/unixODBC-2.3.7/tests/diag.h +new file mode 100644 +index 0000000..af8775b +--- /dev/null ++++ b/unixODBC-2.3.7/tests/diag.h +@@ -0,0 +1,116 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dError : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dError( OdbcTest *pOdbcTest, QString name ); ++ ~dError(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *ehandles, *chandles, *shandles; ++ QLabel *l_ehandle, *l_chandle, *l_shandle, *l_buffer_len; ++ QCheckBox *native_valid, *error_valid, *perror_valid, *sqlstate_valid; ++ QLineEdit *buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void native_clkd(); ++ void error_clkd(); ++ void perror_clkd(); ++ void sqlstate_clkd(); ++}; ++ ++class dGetDiagRec : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetDiagRec( OdbcTest *pOdbcTest, QString name ); ++ ~dGetDiagRec(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handle_type, *handles; ++ QLabel *l_handle_type, *l_handles, *l_buffer_len, *l_rec_num; ++ QCheckBox *native_valid, *error_valid, *perror_valid, *sqlstate_valid; ++ QLineEdit *buffer_len, *rec_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void native_clkd(); ++ void error_clkd(); ++ void perror_clkd(); ++ void sqlstate_clkd(); ++ void sel_handle( int ); ++}; ++ ++class dGetDiagField : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetDiagField( OdbcTest *pOdbcTest, QString name ); ++ ~dGetDiagField(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handle_type, *handles, *diag_info; ++ QLabel *l_handle_type, *l_handles, *l_buffer_len, *l_rec_num, *l_diag_info; ++ QCheckBox *diag_ptr_valid, *strlen_valid; ++ QLineEdit *buffer_len, *rec_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void diag_ptr_clkd(); ++ void strlen_clkd(); ++ void sel_handle( int ); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/edit.cpp b/unixODBC-2.3.7/tests/edit.cpp +new file mode 100644 +index 0000000..fac625a +--- /dev/null ++++ b/unixODBC-2.3.7/tests/edit.cpp +@@ -0,0 +1,77 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcTest.h" ++ ++void OdbcTest::undo() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::cut() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::copy() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::paste() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::del() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::clearow() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::selectall() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::wrap() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/installer.cpp b/unixODBC-2.3.7/tests/installer.cpp +new file mode 100644 +index 0000000..afec9bf +--- /dev/null ++++ b/unixODBC-2.3.7/tests/installer.cpp +@@ -0,0 +1,201 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcTest.h" ++ ++void OdbcTest::slotManageDataSources() ++{ ++#ifdef WIN32 ++ if ( !SQLManageDataSources( (SQLHWND)this->winId() ) ) ++ { ++ QMessageBox::about( this, "ODBC Test", "SQLManageDataSources() returned FALSE." ); ++ } ++#else ++ ODBCINSTWND Wnd; ++ ++ strcpy( Wnd.szUI, "odbcinstQ4" ); ++ Wnd.hWnd = this; ++ ++ if ( !SQLManageDataSources( &Wnd ) ) ++ { ++ QMessageBox::about( this, "ODBC Test", "SQLManageDataSources() returned FALSE." ); ++ } ++#endif ++} ++ ++void OdbcTest::slotRemoveDefaultDataSource() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotConfigDataSource() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotCreateDataSource() ++{ ++#ifdef WIN32 ++ if ( !SQLCreateDataSource( (SQLHWND)this->winId(), NULL ) ) ++ { ++ QMessageBox::about( this, "ODBC Test", "SQLCreateDataSource() returned FALSE." ); ++ } ++#else ++ ODBCINSTWND Wnd; ++ ++ strcpy( Wnd.szUI, "odbcinstQ4" ); ++ Wnd.hWnd = this; ++ ++ if ( !SQLCreateDataSource( &Wnd, NULL ) ) ++ { ++ QMessageBox::about( this, "ODBC Test", "SQLCreateDataSource() returned FALSE." ); ++ } ++#endif ++} ++ ++void OdbcTest::slotValidDSN() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotRemoveDSNFromIni() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotWriteDSNToIni() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotRemoveDrivers() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotConfigDrivers() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotInstallDriver() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotInstallDriverEx() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotGetInstalledDrivers() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotRemoveDriverManager() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotInstallDriverManager() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotReadFileDSN() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotWriteFileDSN() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotWritePrivateProfileString() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotGetPrivateProfileString() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotInstallTranslator() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotInstallTranslatorEx() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotRemoveTranslator() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotGetTranslator() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotSetConfigMode() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotGetConfigMode() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/main.cpp b/unixODBC-2.3.7/tests/main.cpp +new file mode 100644 +index 0000000..71d056c +--- /dev/null ++++ b/unixODBC-2.3.7/tests/main.cpp +@@ -0,0 +1,41 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcTest.h" ++ ++int main( int argc, char ** argv ) ++{ ++ QApplication a( argc, argv ); ++ OdbcTest m; ++ ++ m.show(); ++ ++ return a.exec(); ++} ++ ++ +diff --git a/unixODBC-2.3.7/tests/open.cpp b/unixODBC-2.3.7/tests/open.cpp +new file mode 100644 +index 0000000..510c73e +--- /dev/null ++++ b/unixODBC-2.3.7/tests/open.cpp +@@ -0,0 +1,48 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "OdbcTest.h" ++ ++void OdbcTest::slotOpen() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotSaveAs() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotSaveOpt() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ +diff --git a/unixODBC-2.3.7/tests/results.cpp b/unixODBC-2.3.7/tests/results.cpp +new file mode 100644 +index 0000000..addcbd5 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/results.cpp +@@ -0,0 +1,3077 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "results.h" ++#include "OdbcTest.h" ++ ++static attr_value data_types[] = ++{ ++ { "SQL_C_CHAR", SQL_C_CHAR, "1.0", 0}, ++ { "SQL_C_BINARY", SQL_C_BINARY, "1.0", 0}, ++ { "SQL_C_BIT", SQL_C_BIT, "1.0", 0}, ++ { "SQL_C_BOOKMARK", SQL_C_BOOKMARK, "2.0", 0}, ++ { "SQL_C_DATE", SQL_C_DATE, "1.0", 0}, ++ { "SQL_C_DOUBLE", SQL_C_DOUBLE, "1.0", 0}, ++ { "SQL_C_FLOAT", SQL_C_FLOAT, "1.0", 0}, ++ { "SQL_C_GUID", SQL_C_GUID, "1.0", 0}, ++ { "SQL_C_INTERVAL_DAY", SQL_C_INTERVAL_DAY, "3.0", 0}, ++ { "SQL_C_INTERVAL_DAY_TO_HOUR", SQL_C_INTERVAL_DAY_TO_HOUR, "3.0", 0}, ++ { "SQL_C_INTERVAL_DAY_TO_MINUTE", SQL_C_INTERVAL_DAY_TO_MINUTE, "3.0", 0}, ++ { "SQL_C_INTERVAL_DAY_TO_SECOND", SQL_C_INTERVAL_DAY_TO_SECOND, "3.0", 0}, ++ { "SQL_C_INTERVAL_HOUR", SQL_C_INTERVAL_HOUR, "3.0", 0}, ++ { "SQL_C_INTERVAL_HOUR_TO_MINUTE", SQL_C_INTERVAL_HOUR_TO_MINUTE, "3.0", 0}, ++ { "SQL_C_INTERVAL_HOUR_TO_SECOND", SQL_C_INTERVAL_HOUR_TO_SECOND, "3.0", 0}, ++ { "SQL_C_INTERVAL_MINUTE_TO_SECOND", SQL_C_INTERVAL_MINUTE_TO_SECOND, "3.0", 0}, ++ { "SQL_C_INTERVAL_MONTH", SQL_C_INTERVAL_MONTH, "3.0", 0}, ++ { "SQL_C_INTERVAL_MINUTE", SQL_C_INTERVAL_MINUTE, "3.0", 0}, ++ { "SQL_C_INTERVAL_SECOND", SQL_C_INTERVAL_SECOND, "3.0", 0}, ++ { "SQL_C_INTERVAL_YEAR", SQL_C_INTERVAL_YEAR, "3.0", 0}, ++ { "SQL_C_INTERVAL_YEAR_TO_MONTH", SQL_C_INTERVAL_YEAR_TO_MONTH, "3.0", 0}, ++ { "SQL_C_LONG", SQL_C_LONG, "2.0", 0}, ++ { "SQL_C_NUMERIC", SQL_C_NUMERIC, "3.0", 0}, ++ { "SQL_C_SBIGINT", SQL_C_SBIGINT, "3.0", 0}, ++ { "SQL_C_SLONG", SQL_C_SLONG, "2.0", 0}, ++ { "SQL_C_SSHORT", SQL_C_SSHORT, "2.0", 0}, ++ { "SQL_C_STINYINT", SQL_C_STINYINT, "2.0", 0}, ++ { "SQL_C_TIME", SQL_C_TIME, "1.0", 0}, ++ { "SQL_C_TIMESTAMP", SQL_C_TIMESTAMP, "1.0", 0}, ++ { "SQL_C_TINYINT", SQL_C_TINYINT, "1.0", 0}, ++ { "SQL_C_TYPE_DATE", SQL_C_TYPE_DATE, "3.0", 0}, ++ { "SQL_C_TYPE_TIME", SQL_C_TYPE_TIME, "3.0", 0}, ++ { "SQL_C_TYPE_TIMESTAMP", SQL_C_TYPE_TIMESTAMP, "3.0", 0}, ++ { "SQL_C_UBIGINT", SQL_C_UBIGINT, "3.0", 0}, ++ { "SQL_C_ULONG", SQL_C_ULONG, "2.0", 0}, ++ { "SQL_C_USHORT", SQL_C_USHORT, "2.0", 0}, ++ { "SQL_C_UTINYINT", SQL_C_UTINYINT, "2.0", 0}, ++ { "SQL_C_VARBOOKMARK", SQL_C_VARBOOKMARK, "3.0", 0}, ++ { "SQL_C_WCHAR", SQL_C_WCHAR, "3.0", 0}, ++ { "SQL_ARD_TYPE", SQL_ARD_TYPE, "3.0", 0}, ++ { "SQL_C_DEFAULT", SQL_C_DEFAULT, "3.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value sql_data_types[] = ++{ ++ { "SQL_CHAR", SQL_CHAR, "1.0", 0}, ++ { "SQL_VARCHAR", SQL_VARCHAR, "1.0", 0}, ++ { "SQL_LONGVARCHAR", SQL_LONGVARCHAR, "1.0", 0}, ++ { "SQL_BINARY", SQL_BINARY, "1.0", 0}, ++ { "SQL_VARBINARY", SQL_VARBINARY, "1.0", 0}, ++ { "SQL_LONGVARBINARY", SQL_LONGVARBINARY, "1.0", 0}, ++ { "SQL_TINYINT", SQL_TINYINT, "1.0", 0}, ++ { "SQL_SMALLINT", SQL_SMALLINT, "1.0", 0}, ++ { "SQL_INTEGER", SQL_INTEGER, "1.0", 0}, ++ { "SQL_BIGINT", SQL_BIGINT, "1.0", 0}, ++ { "SQL_FLOAT", SQL_FLOAT, "1.0", 0}, ++ { "SQL_DOUBLE", SQL_DOUBLE, "1.0", 0}, ++ { "SQL_REAL", SQL_REAL, "1.0", 0}, ++ { "SQL_NUMERIC", SQL_NUMERIC, "1.0", 0}, ++ { "SQL_DATETIME", SQL_DATETIME, "1.0", 0}, ++ { "SQL_DATE", SQL_DATE, "1.0", 0}, ++ { "SQL_TIME", SQL_TIME, "1.0", 0}, ++ { "SQL_TIMESTAMP", SQL_TIMESTAMP, "1.0", 0}, ++ { "SQL_INTERVAL_DAY", SQL_INTERVAL_DAY, "3.0", 0}, ++ { "SQL_INTERVAL_DAY_TO_HOUR", SQL_INTERVAL_DAY_TO_HOUR, "3.0", 0}, ++ { "SQL_INTERVAL_DAY_TO_MINUTE", SQL_INTERVAL_DAY_TO_MINUTE, "3.0", 0}, ++ { "SQL_INTERVAL_DAY_TO_SECOND", SQL_INTERVAL_DAY_TO_SECOND, "3.0", 0}, ++ { "SQL_INTERVAL_HOUR", SQL_INTERVAL_HOUR, "3.0", 0}, ++ { "SQL_INTERVAL_HOUR_TO_MINUTE", SQL_INTERVAL_HOUR_TO_MINUTE, "3.0", 0}, ++ { "SQL_INTERVAL_HOUR_TO_SECOND", SQL_INTERVAL_HOUR_TO_SECOND, "3.0", 0}, ++ { "SQL_INTERVAL_MINUTE_TO_SECOND", SQL_INTERVAL_MINUTE_TO_SECOND, "3.0", 0}, ++ { "SQL_INTERVAL_MONTH", SQL_INTERVAL_MONTH, "3.0", 0}, ++ { "SQL_INTERVAL_MINUTE", SQL_INTERVAL_MINUTE, "3.0", 0}, ++ { "SQL_INTERVAL_SECOND", SQL_INTERVAL_SECOND, "3.0", 0}, ++ { "SQL_INTERVAL_YEAR", SQL_INTERVAL_YEAR, "3.0", 0}, ++ { "SQL_INTERVAL_YEAR_TO_MONTH", SQL_INTERVAL_YEAR_TO_MONTH, "3.0", 0}, ++ { "SQL_GUID", SQL_GUID, "3.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_options field_ident_struct[] = ++{ ++ { "SQL_DESC_AUTO_UNIQUE_VALUE", SQL_DESC_AUTO_UNIQUE_VALUE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_BASE_COLUMN_NAME", SQL_DESC_BASE_COLUMN_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_BASE_TABLE_NAME", SQL_DESC_BASE_TABLE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_CASE_SENSITIVE", SQL_DESC_CASE_SENSITIVE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_CATALOG_NAME", SQL_DESC_CATALOG_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_CONCISE_TYPE", SQL_DESC_CONCISE_TYPE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_COUNT", SQL_DESC_COUNT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_DISPLAY_SIZE", SQL_DESC_DISPLAY_SIZE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_FIXED_PREC_SCALE", SQL_DESC_FIXED_PREC_SCALE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_LABEL", SQL_DESC_LABEL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_LENGTH", SQL_DESC_LENGTH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_LITERAL_PREFIX", SQL_DESC_LITERAL_PREFIX, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_LITERAL_SUFFIX", SQL_DESC_LITERAL_SUFFIX, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_LOCAL_TYPE_NAME", SQL_DESC_LOCAL_TYPE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_NAME", SQL_DESC_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_NULLABLE", SQL_DESC_NULLABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_NUM_PREC_RADIX", SQL_DESC_NUM_PREC_RADIX, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_OCTET_LENGTH", SQL_DESC_OCTET_LENGTH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_PRECISION", SQL_DESC_PRECISION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_SCALE", SQL_DESC_SCALE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_SCHEMA_NAME", SQL_DESC_SCHEMA_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_SEARCHABLE", SQL_DESC_SEARCHABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_TABLE_NAME", SQL_DESC_TABLE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_TYPE", SQL_DESC_TYPE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_TYPE_NAME", SQL_DESC_TYPE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_DESC_UNNAMED", SQL_DESC_UNNAMED, ++ { ++ { NULL, 0, NULL, 0} ++ }, "3.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_UNSIGNED", SQL_DESC_UNSIGNED, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_DESC_UPDATABLE", SQL_DESC_UPDATABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0} ++}; ++ ++static attr_options ca_field_ident_struct[] = ++{ ++ { "SQL_COLUMN_AUTO_INCREMENT", SQL_COLUMN_AUTO_INCREMENT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_CASE_SENSITIVE", SQL_COLUMN_CASE_SENSITIVE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_COUNT", SQL_COLUMN_COUNT, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_DISPLAY_SIZE", SQL_COLUMN_DISPLAY_SIZE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_LABEL", SQL_COLUMN_LABEL, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_LENGTH", SQL_COLUMN_LENGTH, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_MONEY", SQL_COLUMN_MONEY, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_NAME", SQL_COLUMN_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_NULLABLE", SQL_COLUMN_NULLABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_OWNER_NAME", SQL_COLUMN_OWNER_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_PRECISION", SQL_COLUMN_PRECISION, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_QUALIFIER_NAME", SQL_COLUMN_QUALIFIER_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "2.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_SCALE", SQL_COLUMN_SCALE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_SEARCHABLE", SQL_COLUMN_SEARCHABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_TABLE_NAME", SQL_COLUMN_TABLE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_TYPE", SQL_COLUMN_TYPE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_TYPE_NAME", SQL_COLUMN_TYPE_NAME, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_CHAR, 0, 0 ++ }, ++ { "SQL_COLUMN_UNSIGNED", SQL_COLUMN_UNSIGNED, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { "SQL_COLUMN_UPDATABLE", SQL_COLUMN_UPDATABLE, ++ { ++ { NULL, 0, NULL, 0} ++ }, "1.0", SQL_INTEGER, 0, 0 ++ }, ++ { NULL, 0, { { NULL, 0, NULL, 0}}, NULL, 0, 0, 0} ++}; ++ ++static attr_value fetch_scroll_orentation[] = ++{ ++ { "SQL_FETCH_NEXT", SQL_FETCH_NEXT, "1.0", 0}, ++ { "SQL_FETCH_PRIOR", SQL_FETCH_PRIOR, "1.0", 0}, ++ { "SQL_FETCH_RELATIVE", SQL_FETCH_RELATIVE, "1.0", 0}, ++ { "SQL_FETCH_ABSOLUTE", SQL_FETCH_ABSOLUTE, "1.0", 0}, ++ { "SQL_FETCH_FIRST", SQL_FETCH_FIRST, "1.0", 0}, ++ { "SQL_FETCH_LAST", SQL_FETCH_LAST, "1.0", 0}, ++ { "SQL_FETCH_BOOKMARK", SQL_FETCH_BOOKMARK, "1.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value set_scroll_cur_operation[] = ++{ ++ { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY, "1.0", 0}, ++ { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK, "1.0", 0}, ++ { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER, "1.0", 0}, ++ { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES, "1.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value set_scroll_ks_values[] = ++{ ++ { "SQL_SCROLL_FORWARD_ONLY", SQL_SCROLL_FORWARD_ONLY, "1.0", 0}, ++ { "SQL_SCROLL_KEYSET_DRIVEN", SQL_SCROLL_KEYSET_DRIVEN, "1.0", 0}, ++ { "SQL_SCROLL_DYNAMIC", SQL_SCROLL_DYNAMIC, "1.0", 0}, ++ { "SQL_SCROLL_STATIC", SQL_SCROLL_STATIC, "1.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value bulk_operation[] = ++{ ++ { "SQL_ADD", SQL_ADD, "3.0", 0}, ++ { "SQL_UPDATE_BY_BOOKMARK", SQL_UPDATE_BY_BOOKMARK, "3.0", 0}, ++ { "SQL_DELETE_BY_BOOKMARK", SQL_DELETE_BY_BOOKMARK, "3.0", 0}, ++ { "SQL_FETCH_BY_BOOKMARK", SQL_FETCH_BY_BOOKMARK, "3.0", 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value set_pos_operation[] = ++{ ++ { "SQL_POSITION", SQL_POSITION, NULL, 0}, ++ { "SQL_REFRESH", SQL_REFRESH, NULL, 0}, ++ { "SQL_UPDATE", SQL_UPDATE, NULL, 0}, ++ { "SQL_DELETE", SQL_DELETE, NULL, 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++static attr_value set_pos_lock_type[] = ++{ ++ { "SQL_LOCK_NO_CHANGE", SQL_LOCK_NO_CHANGE, NULL, 0}, ++ { "SQL_LOCK_EXCLUSIVE", SQL_LOCK_EXCLUSIVE, NULL, 0}, ++ { "SQL_LOCK_UNLOCK", SQL_LOCK_UNLOCK, NULL, 0}, ++ { NULL, 0, NULL, 0} ++}; ++ ++void dNumResultCols::out_handle_ptr_clkd() ++{ ++ if ( valid->isChecked() ) ++ valid->setText( "ColumnCountPtr: SQL_NULL_HANDLE" ); ++ else ++ valid->setText( "ColumnCountPtr: VALID" ); ++} ++ ++void dNumResultCols::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT num_cols; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLNumResultCols():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( valid->isChecked() ) ++ txt.sprintf( " ColumnCountPtr: ." ); ++ else ++ txt.sprintf( " ColumnCountPtr: %p", &num_cols ); ++ pOdbcTest->out_win->append( txt ); ++ ++ num_cols = -9999; ++ ++ SQLRETURN ret = SQLNumResultCols( in_handle, valid->isChecked() ? NULL : &num_cols ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( num_cols == -9999 ) ++ { ++ txt.sprintf( " *ColumnCountPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *ColumnCountPtr: %d", num_cols ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dNumResultCols::dNumResultCols( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ valid = new QCheckBox( "ColumnCountPtr: VALID", this ); ++ valid->setGeometry( 10, 80, 300, 15 ); ++ ++ connect( valid, SIGNAL( clicked()), this, SLOT( out_handle_ptr_clkd())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dNumResultCols::~dNumResultCols() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete valid; ++} ++ ++void dFetch::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLFetch():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLFetch( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dFetch::dFetch( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dFetch::~dFetch() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++} ++ ++void dGetData::target_clkd() ++{ ++ if ( target_valid->isChecked() ) ++ target_valid->setText( "TargetValuePtr: SQL_NULL_POINTER" ); ++ else ++ target_valid->setText( "TargetValuePtr: VALID" ); ++} ++ ++void dGetData::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StrLen_or_IndValuePtr: SQL_NULL_POINTER" ); ++ else ++ strlen_valid->setText( "StrLen_or_IndValuePtr: VALID" ); ++} ++ ++void dGetData::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ int index; ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT column_number; ++ SQLINTEGER b_len, data_type; ++ SQLLEN *strlen_ptr, strlen_or_ind; ++ char *buf = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetData():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ column_number = column_num->text().toInt(); ++ txt.sprintf( " Column Number: %d", column_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = type->currentIndex(); ++ ++ data_type = data_types[ index ].value; ++ txt.sprintf( " Target Type: %s=%d (%s)", data_types[ index ].text, ++ data_types[ index ].value, data_types[ index ].version ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( target_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new char[ 300 ]; ++ } ++ else ++ { ++ buf = new char[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " Target Value Ptr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Target Value Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ strlen_or_ind = -999999; ++ ++ if ( strlen_valid->isChecked()) ++ { ++ strlen_ptr = NULL; ++ } ++ else ++ { ++ strlen_ptr = &strlen_or_ind; ++ } ++ ++ if ( strlen_ptr ) ++ { ++ txt.sprintf( " Strlen_or_Ind Ptr: %p", strlen_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Strlen_or_Ind Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetData( in_handle, column_number, ++ data_type, buf, b_len, strlen_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret ) && strlen_ptr ) ++ { ++ if ( strlen_or_ind == -999999 ) ++ { ++ txt.sprintf( " *Strlen_or_Ind Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Strlen_or_Ind Ptr: %d", strlen_or_ind ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ /* ++ * display the result ++ */ ++ ++ if ( SQL_SUCCEEDED( ret ) && (( strlen_ptr && strlen_or_ind >= 0 ) || !strlen_ptr )) ++ { ++ switch ( data_type ) ++ { ++ case SQL_C_CHAR: ++ if ( strlen( buf ) > 64 ) ++ { ++ buf[ 64 ] = '\0'; ++ txt.sprintf( " *Target Value Ptr: \"%s...\"", buf ); ++ } ++ else ++ { ++ txt.sprintf( " *Target Value Ptr: \"%s\"", buf ); ++ } ++ break; ++ ++ case SQL_C_BIT: ++ { ++ unsigned char bit; ++ ++ memcpy( &bit, buf, sizeof( bit )); ++ txt.sprintf( " *Target Value Ptr: %d", bit ); ++ break; ++ } ++ ++ case SQL_C_DATE: ++ case SQL_C_TYPE_DATE: ++ { ++ SQL_DATE_STRUCT dt; ++ ++ memcpy( &dt, buf, sizeof( dt )); ++ txt.sprintf( " *Target Value Ptr: %04d-%02d-%02d", ++ dt.year, dt.month, dt.day ); ++ break; ++ } ++ ++ case SQL_C_DOUBLE: ++ { ++ double val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %f", val ); ++ break; ++ } ++ ++ case SQL_C_FLOAT: ++ { ++ float val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %f", val ); ++ break; ++ } ++ ++ case SQL_C_INTERVAL_DAY: ++ case SQL_C_INTERVAL_DAY_TO_HOUR: ++ case SQL_C_INTERVAL_DAY_TO_MINUTE: ++ case SQL_C_INTERVAL_DAY_TO_SECOND: ++ case SQL_C_INTERVAL_HOUR: ++ case SQL_C_INTERVAL_HOUR_TO_MINUTE: ++ case SQL_C_INTERVAL_HOUR_TO_SECOND: ++ case SQL_C_INTERVAL_MINUTE_TO_SECOND: ++ case SQL_C_INTERVAL_MINUTE: ++ case SQL_C_INTERVAL_SECOND: ++ { ++ SQL_INTERVAL_STRUCT val; ++ char str[ 128 ]; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr:\n" ); ++ sprintf( str, " interval.interval_type: %d (%s)\n", ++ val.interval_type, pOdbcTest->int_type_as_string( val.interval_type )); ++ txt += str; ++ sprintf( str, " interval.sign: %d\n", val.interval_sign); ++ txt += str; ++ sprintf( str, " interval.intval.day_second.day: %d\n", ++ val.intval.day_second.day); ++ txt += str; ++ sprintf( str, " interval.intval.day_second.hour: %d\n", ++ val.intval.day_second.hour); ++ txt += str; ++ sprintf( str, " interval.intval.day_second.minute: %d\n", ++ val.intval.day_second.minute); ++ txt += str; ++ sprintf( str, " interval.intval.day_second.second: %d\n", ++ val.intval.day_second.second); ++ txt += str; ++ sprintf( str, " interval.intval.day_second.fraction: %09d\n", ++ val.intval.day_second.fraction); ++ txt += str; ++ break; ++ } ++ ++ case SQL_C_INTERVAL_YEAR: ++ case SQL_C_INTERVAL_YEAR_TO_MONTH: ++ case SQL_C_INTERVAL_MONTH: ++ { ++ SQL_INTERVAL_STRUCT val; ++ char str[ 128 ]; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr:\n" ); ++ sprintf( str, " interval.interval_type: %d (%s)\n", ++ val.interval_type, pOdbcTest->int_type_as_string( val.interval_type )); ++ txt += str; ++ sprintf( str, " interval.sign: %d\n", val.interval_sign); ++ txt += str; ++ sprintf( str, " interval.intval.year_month.year: %d\n", ++ val.intval.year_month.year); ++ txt += str; ++ sprintf( str, " interval.intval.year_month.month: %d\n", ++ val.intval.year_month.month); ++ txt += str; ++ break; ++ } ++ ++ case SQL_C_LONG: ++ { ++ long val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %d (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_NUMERIC: ++ { ++ break; ++ } ++ ++ case SQL_C_SBIGINT: ++ { ++ break; ++ } ++ ++ case SQL_C_SLONG: ++ { ++ long val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %d (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_SSHORT: ++ { ++ short val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %d (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_STINYINT: ++ { ++ char val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %d (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_TIME: ++ case SQL_C_TYPE_TIME: ++ { ++ SQL_TIME_STRUCT dt; ++ ++ memcpy( &dt, buf, sizeof( dt )); ++ txt.sprintf( " *Target Value Ptr: %02d:%02d:%02d", ++ dt.hour, dt.minute, dt.second ); ++ break; ++ } ++ ++ case SQL_C_TIMESTAMP: ++ case SQL_C_TYPE_TIMESTAMP: ++ { ++ SQL_TIMESTAMP_STRUCT dt; ++ ++ memcpy( &dt, buf, sizeof( dt )); ++ txt.sprintf( " *Target Value Ptr: %04d-%02d%02d %02d:%02d:%02d.%0d", ++ dt.year, dt.month, dt.day, ++ dt.hour, dt.minute, dt.second, dt.fraction ); ++ break; ++ } ++ ++ case SQL_C_TINYINT: ++ { ++ char val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %d (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_UBIGINT: ++ { ++ break; ++ } ++ ++ case SQL_C_ULONG: ++ { ++ unsigned long val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %lu (0x%lx)", val, val ); ++ break; ++ } ++ ++ case SQL_C_USHORT: ++ { ++ unsigned short val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %u (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_UTINYINT: ++ { ++ unsigned char val; ++ ++ memcpy( &val, buf, sizeof( val )); ++ txt.sprintf( " *Target Value Ptr: %u (0x%x)", val, val ); ++ break; ++ } ++ ++ case SQL_C_BINARY: ++ case SQL_C_GUID: ++ case SQL_C_WCHAR: ++ case SQL_ARD_TYPE: ++ case SQL_C_DEFAULT: ++ default: ++ txt.sprintf( " *Target Value Ptr: 0x" ); ++ if ( strlen_ptr ) ++ { ++ if ( strlen_or_ind > 32 ) ++ { ++ for ( int i = 0; i < 32; i ++ ) ++ { ++ char tmp[ 3 ]; ++ sprintf( tmp, "%X", buf[ i ] ); ++ txt += tmp; ++ } ++ } ++ else ++ { ++ for ( int i = 0; i < strlen_or_ind; i ++ ) ++ { ++ char tmp[ 3 ]; ++ sprintf( tmp, "%X", buf[ i ] ); ++ txt += tmp; ++ } ++ } ++ } ++ else ++ { ++ if ( b_len > 32 ) ++ { ++ for ( int i = 0; i < 32; i ++ ) ++ { ++ char tmp[ 3 ]; ++ sprintf( tmp, "%X", buf[ i ] ); ++ txt += tmp; ++ } ++ } ++ else ++ { ++ for ( int i = 0; i < b_len; i ++ ) ++ { ++ char tmp[ 3 ]; ++ sprintf( tmp, "%X", buf[ i ] ); ++ txt += tmp; ++ } ++ } ++ } ++ break; ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dGetData::dGetData( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ column_num = new QLineEdit( this ); ++ column_num->setGeometry( 130, 80, 70, 20 ); ++ column_num->setMaxLength( 6 ); ++ column_num->setText( "1" ); ++ ++ l_column_num = new QLabel( "Column Number:", this ); ++ l_column_num->setGeometry( 10, 80, 120, 20 ); ++ ++ type = new QComboBox( this ); ++ type->setGeometry( 130, 110, 340, 20 ); ++ ++ pOdbcTest->fill_list_box( data_types, type ); ++ ++ l_type = new QLabel( "Target Type:", this ); ++ l_type->setGeometry( 10, 110, 120, 20 ); ++ ++ target_valid = new QCheckBox( "TargetValuePtr: VALID", this ); ++ target_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ strlen_valid = new QCheckBox( "StrLen_or_IndValuePtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 140, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 320, 140, 60, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( target_valid, SIGNAL( clicked()), this, SLOT( target_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++} ++ ++dGetData::~dGetData() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete column_num; ++ delete l_column_num; ++ delete type; ++ delete l_type; ++ delete target_valid; ++ delete strlen_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dDescribeCol::name_clkd() ++{ ++ if ( name_valid->isChecked() ) ++ name_valid->setText( "Column Name Ptr: SQL_NULL_PTR" ); ++ else ++ name_valid->setText( "Column Name Ptr: VALID" ); ++} ++ ++void dDescribeCol::type_clkd() ++{ ++ if ( type_valid->isChecked() ) ++ type_valid->setText( "Name Length Ptr: SQL_NULL_PTR" ); ++ else ++ type_valid->setText( "Name Length Ptr: VALID" ); ++} ++ ++void dDescribeCol::size_clkd() ++{ ++ if ( size_valid->isChecked() ) ++ size_valid->setText( "Column Size Ptr: SQL_NULL_PTR" ); ++ else ++ size_valid->setText( "Column Size Ptr: VALID" ); ++} ++ ++void dDescribeCol::digit_clkd() ++{ ++ if ( digit_valid->isChecked() ) ++ digit_valid->setText( "Decimal Digits Ptr: SQL_NULL_PTR" ); ++ else ++ digit_valid->setText( "Decimal Digits Ptr: VALID" ); ++} ++ ++void dDescribeCol::null_clkd() ++{ ++ if ( null_valid->isChecked() ) ++ null_valid->setText( "Nullable Ptr: SQL_NULL_PTR" ); ++ else ++ null_valid->setText( "Nullable Ptr: VALID" ); ++} ++ ++const char *dDescribeCol::data_type_to_str( int type ) ++{ ++ struct attr_value *data_type = sql_data_types; ++ ++ while ( TRUE ) ++ { ++ if ( !data_type->text ) ++ break; ++ ++ if ( data_type->value == type ) ++ break; ++ ++ data_type ++; ++ }; ++ ++ if ( data_type->text ) ++ return data_type->text; ++ else ++ return NULL; ++} ++ ++void dDescribeCol::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT column_number; ++ SQLSMALLINT buffer_length; ++ SQLCHAR *column_name; ++ SQLSMALLINT *name_length_ptr, name_length; ++ SQLSMALLINT *data_type_ptr, data_type; ++ SQLULEN *column_size_ptr, column_size; ++ SQLSMALLINT *decimal_digit_ptr, decimal_digit; ++ SQLSMALLINT *nullable_ptr, nullable; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLDescribeCol():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ column_number = column_num->text().toInt(); ++ txt.sprintf( " Column Number: %d", column_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ buffer_length = column_len->text().toInt(); ++ ++ if ( name_valid->isChecked()) ++ { ++ column_name = NULL; ++ } ++ else if ( buffer_length < 300 ) ++ { ++ column_name = new SQLCHAR[ 300 ]; ++ } ++ else ++ { ++ column_name = new SQLCHAR[ buffer_length ]; ++ } ++ ++ if ( column_name ) ++ { ++ txt.sprintf( " Column Name Ptr: %p", column_name ); ++ pOdbcTest->out_win->append( txt ); ++ txt.sprintf( " Column Name Length: %d", buffer_length ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Column Name Ptr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( name_valid->isChecked() ) ++ { ++ name_length_ptr = NULL; ++ txt.sprintf( " Name Length Ptr: " ); ++ } ++ else ++ { ++ name_length_ptr = &name_length; ++ txt.sprintf( " Name Length Ptr: %p", name_length_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ name_length = -9999; ++ ++ if ( type_valid->isChecked() ) ++ { ++ data_type_ptr = NULL; ++ txt.sprintf( " Data Type Ptr: " ); ++ } ++ else ++ { ++ data_type_ptr = &data_type; ++ txt.sprintf( " Data Type Ptr: %p", data_type_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ data_type = -9999; ++ ++ if ( name_valid->isChecked() ) ++ { ++ column_size_ptr = NULL; ++ txt.sprintf( " Column Size Ptr: " ); ++ } ++ else ++ { ++ column_size_ptr = &column_size; ++ txt.sprintf( " Column Size Ptr: %p", column_size_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ column_size = 9999; ++ ++ if ( digit_valid->isChecked() ) ++ { ++ decimal_digit_ptr = NULL; ++ txt.sprintf( " Decimal Digits Ptr: " ); ++ } ++ else ++ { ++ decimal_digit_ptr = &decimal_digit; ++ txt.sprintf( " Decimal Digits Ptr: %p", decimal_digit_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ decimal_digit = -9999; ++ ++ if ( null_valid->isChecked() ) ++ { ++ nullable_ptr = NULL; ++ txt.sprintf( " Nullable Ptr: " ); ++ } ++ else ++ { ++ nullable_ptr = &nullable; ++ txt.sprintf( " Nullable Ptr: %p", nullable_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ nullable = -9999; ++ ++ SQLRETURN ret = SQLDescribeCol( in_handle, column_number, ++ column_name, ++ buffer_length, ++ name_length_ptr, ++ data_type_ptr, ++ column_size_ptr, ++ decimal_digit_ptr, ++ nullable_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( column_name ) ++ { ++ txt.sprintf( " Column Name: %s", column_name ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( name_length_ptr ) ++ { ++ if ( name_length == -9999 ) ++ { ++ txt.sprintf( " *Name Length Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Name Length Ptr: %d", name_length ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( data_type_ptr ) ++ { ++ if ( data_type == -9999 ) ++ { ++ txt.sprintf( " *Data Type Ptr: " ); ++ } ++ else ++ { ++ const char *str = data_type_to_str( data_type ); ++ ++ if ( str ) ++ txt.sprintf( " *Data Type Ptr: %s (%d)", str, data_type ); ++ else ++ txt.sprintf( " *Data Type Ptr: %d", data_type ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( column_size_ptr ) ++ { ++ if ( column_size == 9999 ) ++ { ++ txt.sprintf( " *Column Size Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Column Size Ptr: %d", column_size ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( decimal_digit_ptr ) ++ { ++ if ( decimal_digit == -9999 ) ++ { ++ txt.sprintf( " *Decimal Digits Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Decimal Digits Ptr: %d", decimal_digit ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( nullable_ptr ) ++ { ++ if ( nullable == -9999 ) ++ { ++ txt.sprintf( " *Nullable Ptr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *Nullable Ptr: %d", nullable ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dDescribeCol::dDescribeCol( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ column_num = new QLineEdit( this ); ++ column_num->setGeometry( 130, 80, 70, 20 ); ++ column_num->setMaxLength( 6 ); ++ column_num->setText( "1" ); ++ ++ l_column_num = new QLabel( "Column Number:", this ); ++ l_column_num->setGeometry( 10, 80, 120, 20 ); ++ ++ column_len = new QLineEdit( this ); ++ column_len->setGeometry( 400, 110, 70, 20 ); ++ column_len->setMaxLength( 6 ); ++ column_len->setText( "300" ); ++ ++ l_column_len = new QLabel( "Column Buffer Len:", this ); ++ l_column_len->setGeometry( 280, 110, 110, 20 ); ++ ++ name_valid = new QCheckBox( "Column Name Ptr: VALID", this ); ++ name_valid->setGeometry( 10, 110, 250, 15 ); ++ ++ type_valid = new QCheckBox( "Name Length Ptr: VALID", this ); ++ type_valid->setGeometry( 10, 140, 250, 15 ); ++ ++ size_valid = new QCheckBox( "Column Size Ptr: VALID", this ); ++ size_valid->setGeometry( 10, 170, 250, 15 ); ++ ++ digit_valid = new QCheckBox( "Decimal Digits Ptr: VALID", this ); ++ digit_valid->setGeometry( 10, 200, 250, 15 ); ++ ++ null_valid = new QCheckBox( "Nullable Ptr: VALID", this ); ++ null_valid->setGeometry( 10, 230, 250, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( name_valid, SIGNAL( clicked()), this, SLOT( name_clkd())); ++ connect( type_valid, SIGNAL( clicked()), this, SLOT( type_clkd())); ++ connect( size_valid, SIGNAL( clicked()), this, SLOT( size_clkd())); ++ connect( digit_valid, SIGNAL( clicked()), this, SLOT( digit_clkd())); ++ connect( null_valid, SIGNAL( clicked()), this, SLOT( null_clkd())); ++} ++ ++dDescribeCol::~dDescribeCol() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete column_num; ++ delete l_column_num; ++ delete column_len; ++ delete l_column_len; ++ delete name_valid; ++ delete type_valid; ++ delete size_valid; ++ delete digit_valid; ++ delete null_valid; ++} ++ ++void dRowCount::Valid() ++{ ++ if ( valid->isChecked() ) ++ valid->setText( "RowCountPtr: SQL_NULL_PTR" ); ++ else ++ valid->setText( "RowCountPtr: VALID" ); ++} ++ ++void dRowCount::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLLEN num_rows; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLRowCount():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_PTR" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( valid->isChecked() ) ++ txt.sprintf( " RowCountPtr: out_win->append( txt ); ++ ++ num_rows = -9999; ++ ++ SQLRETURN ret = SQLRowCount( in_handle, valid->isChecked() ? NULL : &num_rows ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( num_rows == -9999 ) ++ { ++ txt.sprintf( " *RowCountPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *RowCountPtr: %d", num_rows ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dRowCount::dRowCount( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ valid = new QCheckBox( "RowCountPtr: VALID", this ); ++ valid->setGeometry( 10, 80, 300, 15 ); ++ ++ connect( valid, SIGNAL( clicked()), this, SLOT( Valid())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dRowCount::~dRowCount() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete valid; ++} ++ ++void dMoreResults::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLMoreResults():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLMoreResults( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dMoreResults::dMoreResults( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dMoreResults::~dMoreResults() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++} ++ ++void dSetPos::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLUSMALLINT row_num, op_val, lock_val; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetPos():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ row_num = row_number->text().toInt(); ++ txt.sprintf( " Row Number: %d", row_num ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = operation->currentIndex(); ++ ++ op_val = set_pos_operation[ index ].value; ++ txt.sprintf( " Operation: %s=%d", set_pos_operation[ index ].text, ++ set_pos_operation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = lock_type->currentIndex(); ++ ++ lock_val = set_pos_lock_type[ index ].value; ++ txt.sprintf( " Lock Type: %s=%d", set_pos_lock_type[ index ].text, ++ set_pos_lock_type[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetPos( in_handle, row_num, op_val, lock_val ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetPos::dSetPos( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ row_number = new QLineEdit( this ); ++ row_number->setGeometry( 130, 80, 70, 20 ); ++ row_number->setMaxLength( 6 ); ++ row_number->setText( "1" ); ++ ++ l_row_number = new QLabel( "Row Number:", this ); ++ l_row_number->setGeometry( 10, 80, 120, 20 ); ++ ++ operation = new QComboBox( this ); ++ operation->setGeometry( 130, 110, 200, 20 ); ++ ++ pOdbcTest->fill_list_box( set_pos_operation, operation ); ++ ++ l_operation = new QLabel( "Operation:", this ); ++ l_operation->setGeometry( 10, 110, 120, 20 ); ++ ++ lock_type = new QComboBox( this ); ++ lock_type->setGeometry( 130, 140, 200, 20 ); ++ ++ pOdbcTest->fill_list_box( set_pos_lock_type, lock_type ); ++ ++ l_lock_type = new QLabel( "Lock Type:", this ); ++ l_lock_type->setGeometry( 10, 140, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dSetPos::~dSetPos() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete operation; ++ delete lock_type; ++ delete l_handle; ++ delete l_operation; ++ delete l_lock_type; ++ delete row_number; ++ delete l_row_number; ++} ++ ++void dBulkOperations::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLUSMALLINT op_val; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLBulkOperations():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = operation->currentIndex(); ++ ++ op_val = bulk_operation[ index ].value; ++ txt.sprintf( " Operation: %s=%d", bulk_operation[ index ].text, ++ bulk_operation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = operation->currentIndex(); ++ ++ op_val = bulk_operation[ index ].value; ++ txt.sprintf( " Operation: %s=%d", bulk_operation[ index ].text, ++ bulk_operation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLBulkOperations( in_handle, op_val ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dBulkOperations::dBulkOperations( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 150,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 230,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 310,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ operation = new QComboBox( this ); ++ operation->setGeometry( 130, 80, 250, 20 ); ++ ++ pOdbcTest->fill_list_box( bulk_operation, operation ); ++ ++ l_operation = new QLabel( "Operation:", this ); ++ l_operation->setGeometry( 10, 80, 100, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dBulkOperations::~dBulkOperations() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete operation; ++ delete l_handle; ++ delete l_operation; ++} ++ ++void dColAttribute::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ int index; ++ SQLUSMALLINT column_number; ++ SQLUSMALLINT field_identifier; ++ SQLPOINTER buf; ++ SQLSMALLINT b_len, *b_len_ptr, b_len_value; ++ SQLLEN *numeric_ptr, numeric_value; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLColAttribute():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ column_number = col_num->text().toInt(); ++ txt.sprintf( " Column Number: %d", column_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ field_identifier = field_ident_struct[ index = field_ident->currentIndex() ].attr; ++ txt.sprintf( " Field Identifier: %s=%d", ++ field_ident_struct[ index ].text, ++ field_ident_struct[ index ].attr ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( char_ptr_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = malloc( 300 ); ++ } ++ else ++ { ++ buf = malloc( b_len ); ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " CharacterAttributePtr: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " CharacterAttributePtr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked()) ++ { ++ b_len_ptr = NULL; ++ } ++ else ++ { ++ b_len_ptr = &b_len_value; ++ } ++ ++ if ( b_len_ptr ) ++ { ++ txt.sprintf( " StringLengthPtr: %p", b_len_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " StringLengthPtr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ b_len_value = -9999; ++ ++ if ( numeric_valid->isChecked()) ++ { ++ numeric_ptr = NULL; ++ } ++ else ++ { ++ numeric_ptr = &numeric_value; ++ } ++ ++ if ( numeric_ptr ) ++ { ++ txt.sprintf( " NumericAttributePtr: %p", numeric_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " NumericAttributePtr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ numeric_value = -99999; ++ ++ SQLRETURN ret = SQLColAttribute( in_handle, ++ column_number, ++ field_identifier, ++ buf, ++ b_len, ++ b_len_ptr, ++ numeric_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( field_ident_struct[ index ].data_type == SQL_CHAR ) ++ { ++ if ( b_len_ptr ) ++ { ++ if ( b_len_value != -9999 ) ++ { ++ txt.sprintf( " *StringLengthPtr: %d", b_len_value ); ++ } ++ else ++ { ++ txt.sprintf( " *StringLengthPtr: " ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " *CharacterAttributePtr: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ else ++ { ++ if ( numeric_ptr ) ++ { ++ txt.sprintf( " *NumericAttributePtr: %d", numeric_value ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ free( buf ); ++} ++ ++void dColAttribute::char_ptr_clkd() ++{ ++ if ( char_ptr_valid->isChecked() ) ++ char_ptr_valid->setText( "CharacterAttributePtr: SQL_NULL_HANDLE" ); ++ else ++ char_ptr_valid->setText( "CharacterAttributePtr: VALID" ); ++} ++ ++void dColAttribute::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "StringLengthPtr: SQL_NULL_HANDLE" ); ++ else ++ strlen_valid->setText( "StringLengthPtr: VALID" ); ++} ++ ++void dColAttribute::numeric_clkd() ++{ ++ if ( numeric_valid->isChecked() ) ++ numeric_valid->setText( "NumericAttributePtr: SQL_NULL_HANDLE" ); ++ else ++ numeric_valid->setText( "NumericAttributePtr: VALID" ); ++} ++ ++dColAttribute::dColAttribute( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 250,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 330,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 410,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handles = new QLabel( "Statement Handle:", this ); ++ l_handles->setGeometry( 10, 50, 120, 20 ); ++ ++ col_num = new QLineEdit( this ); ++ col_num->setGeometry( 130, 80, 70, 20 ); ++ col_num->setMaxLength( 6 ); ++ col_num->setText( "1" ); ++ ++ l_col_num = new QLabel( "ColumnNumber:", this ); ++ l_col_num->setGeometry( 10, 80, 100, 20 ); ++ ++ field_ident = new QComboBox( this ); ++ field_ident->setGeometry( 130, 110, 350, 20 ); ++ pOdbcTest->fill_list_box( field_ident_struct, field_ident ); ++ ++ l_field_ident = new QLabel( "FieldIdentifier::", this ); ++ l_field_ident->setGeometry( 10, 110, 120, 20 ); ++ ++ char_ptr_valid = new QCheckBox( "CharacterAttributePtr: VALID", this ); ++ char_ptr_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 140, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "BufferLength:", this ); ++ l_buffer_len->setGeometry( 300, 140, 80, 20 ); ++ ++ strlen_valid = new QCheckBox( "StringLengthPtr: VALID", this ); ++ strlen_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ numeric_valid = new QCheckBox( "NumericAttributePtr: VALID", this ); ++ numeric_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( char_ptr_valid, SIGNAL( clicked()), this, SLOT( char_ptr_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++ connect( numeric_valid, SIGNAL( clicked()), this, SLOT( numeric_clkd())); ++} ++ ++dColAttribute::~dColAttribute() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete col_num; ++ delete l_col_num; ++ delete field_ident; ++ delete l_field_ident; ++ delete char_ptr_valid; ++ delete strlen_valid; ++ delete numeric_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dColAttributes::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ int index; ++ SQLUSMALLINT column_number; ++ SQLUSMALLINT field_identifier; ++ SQLPOINTER buf; ++ SQLSMALLINT b_len, *b_len_ptr, b_len_value; ++ SQLLEN *numeric_ptr, numeric_value; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLColAttributes():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ column_number = col_num->text().toInt(); ++ txt.sprintf( " icol: %d", column_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ field_identifier = ca_field_ident_struct[ index = field_ident->currentIndex() ].attr; ++ txt.sprintf( " fDescType: %s=%d", ++ ca_field_ident_struct[ index ].text, ++ ca_field_ident_struct[ index ].attr ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( char_ptr_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = malloc( 300 ); ++ } ++ else ++ { ++ buf = malloc( b_len ); ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " rgbDesc: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " rgbDesc: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " cbDescMax: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strlen_valid->isChecked()) ++ { ++ b_len_ptr = NULL; ++ } ++ else ++ { ++ b_len_ptr = &b_len_value; ++ } ++ ++ if ( b_len_ptr ) ++ { ++ txt.sprintf( " pcbDesc: %p", b_len_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " pcbDesc: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ b_len_value = -9999; ++ ++ if ( numeric_valid->isChecked()) ++ { ++ numeric_ptr = NULL; ++ } ++ else ++ { ++ numeric_ptr = &numeric_value; ++ } ++ ++ if ( numeric_ptr ) ++ { ++ txt.sprintf( " pfDesc: %p", numeric_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " pfDesc: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ numeric_value = -99999; ++ ++ SQLRETURN ret = SQLColAttributes( in_handle, ++ column_number, ++ field_identifier, ++ buf, ++ b_len, ++ b_len_ptr, ++ numeric_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( ca_field_ident_struct[ index ].data_type == SQL_CHAR ) ++ { ++ if ( b_len_ptr ) ++ { ++ if ( b_len_value != -9999 ) ++ { ++ txt.sprintf( " *pcbDesc: %d", b_len_value ); ++ } ++ else ++ { ++ txt.sprintf( " *pcbDesc: " ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " *rgbDesc: %s", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ else ++ { ++ if ( numeric_ptr ) ++ { ++ txt.sprintf( " *pfDesc: %d", numeric_value ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( buf ) ++ free( buf ); ++} ++ ++void dColAttributes::char_ptr_clkd() ++{ ++ if ( char_ptr_valid->isChecked() ) ++ char_ptr_valid->setText( "rgbDesc: SQL_NULL_HANDLE" ); ++ else ++ char_ptr_valid->setText( "rgbDesc: VALID" ); ++} ++ ++void dColAttributes::strlen_clkd() ++{ ++ if ( strlen_valid->isChecked() ) ++ strlen_valid->setText( "pcbDesc: SQL_NULL_HANDLE" ); ++ else ++ strlen_valid->setText( "pcbDesc: VALID" ); ++} ++ ++void dColAttributes::numeric_clkd() ++{ ++ if ( numeric_valid->isChecked() ) ++ numeric_valid->setText( "pfDesc: SQL_NULL_HANDLE" ); ++ else ++ numeric_valid->setText( "pfDesc: VALID" ); ++} ++ ++dColAttributes::dColAttributes( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 250,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 330,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 410,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handles = new QLabel( "Statement Handle:", this ); ++ l_handles->setGeometry( 10, 50, 120, 20 ); ++ ++ col_num = new QLineEdit( this ); ++ col_num->setGeometry( 130, 80, 70, 20 ); ++ col_num->setMaxLength( 6 ); ++ col_num->setText( "1" ); ++ ++ l_col_num = new QLabel( "icol:", this ); ++ l_col_num->setGeometry( 10, 80, 100, 20 ); ++ ++ field_ident = new QComboBox( this ); ++ field_ident->setGeometry( 130, 110, 350, 20 ); ++ pOdbcTest->fill_list_box( ca_field_ident_struct, field_ident ); ++ ++ l_field_ident = new QLabel( "fDescType:", this ); ++ l_field_ident->setGeometry( 10, 110, 120, 20 ); ++ ++ char_ptr_valid = new QCheckBox( "rgbDesc: VALID", this ); ++ char_ptr_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 400, 140, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "cbDescMax:", this ); ++ l_buffer_len->setGeometry( 300, 140, 80, 20 ); ++ ++ strlen_valid = new QCheckBox( "pcbDesc: VALID", this ); ++ strlen_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ numeric_valid = new QCheckBox( "pfDesc: VALID", this ); ++ numeric_valid->setGeometry( 10, 200, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( char_ptr_valid, SIGNAL( clicked()), this, SLOT( char_ptr_clkd())); ++ connect( strlen_valid, SIGNAL( clicked()), this, SLOT( strlen_clkd())); ++ connect( numeric_valid, SIGNAL( clicked()), this, SLOT( numeric_clkd())); ++} ++ ++dColAttributes::~dColAttributes() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handles; ++ delete col_num; ++ delete l_col_num; ++ delete field_ident; ++ delete l_field_ident; ++ delete char_ptr_valid; ++ delete strlen_valid; ++ delete numeric_valid; ++ delete buffer_len; ++ delete l_buffer_len; ++} ++ ++void dFetchScroll::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT fetch_orentation; ++ SQLINTEGER fetch_offset; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLFetchScroll():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = orentation->currentIndex(); ++ ++ fetch_orentation = fetch_scroll_orentation[ index ].value; ++ txt.sprintf( " FetchOrentation: %s=%d", fetch_scroll_orentation[ index ].text, ++ fetch_scroll_orentation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ fetch_offset = offset->text().toInt(); ++ txt.sprintf( " FetchOffset: %d", fetch_offset ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLFetchScroll( in_handle, fetch_orentation, fetch_offset ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dFetchScroll::dFetchScroll( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 200,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 280,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 360,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ orentation = new QComboBox( this ); ++ orentation->setGeometry( 130, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( fetch_scroll_orentation, orentation ); ++ ++ l_orentation = new QLabel( "FetchOffset:", this ); ++ l_orentation->setGeometry( 10, 80, 120, 20 ); ++ ++ offset = new QLineEdit( this ); ++ offset->setGeometry( 130, 110, 70, 20 ); ++ offset->setMaxLength( 6 ); ++ offset->setText( "1" ); ++ ++ l_offset = new QLabel( "FetchOffset:", this ); ++ l_offset->setGeometry( 10, 110, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dFetchScroll::~dFetchScroll() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete orentation; ++ delete offset; ++ delete l_handle; ++ delete l_orentation; ++ delete l_offset; ++} ++ ++void dExtendedFetch::count_ptr_clkd() ++{ ++ if ( count_ptr_valid->isChecked() ) ++ count_ptr_valid->setText( "RowCountPtr: SQL_NULL_HANDLE" ); ++ else ++ count_ptr_valid->setText( "RowCountPtr: VALID" ); ++} ++ ++void dExtendedFetch::status_ptr_clkd() ++{ ++ if ( status_ptr_valid->isChecked() ) ++ status_ptr_valid->setText( "RowStatusArray: SQL_NULL_HANDLE" ); ++ else ++ status_ptr_valid->setText( "RowStatusArray: VALID" ); ++} ++ ++void dExtendedFetch::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT fetch_orentation; ++ SQLINTEGER fetch_offset; ++ SQLULEN /* SQLUINTEGER */ *row_count_ptr; ++ SQLULEN /* SQLUINTEGER */ row_count; ++ SQLUSMALLINT *row_status_array; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLExtendedFetch():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = orentation->currentIndex(); ++ ++ fetch_orentation = fetch_scroll_orentation[ index ].value; ++ txt.sprintf( " FetchOrentation: %s=%d", fetch_scroll_orentation[ index ].text, ++ fetch_scroll_orentation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ fetch_offset = offset->text().toInt(); ++ txt.sprintf( " FetchOffset: %d", fetch_offset ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( count_ptr_valid->isChecked()) ++ { ++ row_count_ptr = NULL; ++ } ++ else ++ { ++ row_count_ptr = &row_count; ++ } ++ ++ if ( status_ptr_valid->isChecked()) ++ { ++ row_status_array = NULL; ++ } ++ else ++ { ++ if ( hand->row_array_size > 1 ) ++ { ++ row_status_array = new SQLUSMALLINT[ hand->row_array_size ]; ++ } ++ else ++ { ++ row_status_array = new SQLUSMALLINT[ 1 ]; ++ } ++ } ++ ++ SQLRETURN ret = SQLExtendedFetch( in_handle, fetch_orentation, fetch_offset, row_count_ptr, row_status_array ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( row_count_ptr ) ++ { ++ txt.sprintf( " *RowCountPtr: %d", row_count); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( row_status_array ) ++ { ++ if ( hand->row_array_size > 1 ) ++ { ++ /* ++ * we need to display the rowset here... ++ */ ++ } ++ else ++ { ++ txt.sprintf( " *RowStatusArray: %d", row_status_array[ 0 ]); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++ ++ if ( row_status_array ) ++ { ++ delete row_status_array; ++ } ++} ++ ++dExtendedFetch::dExtendedFetch( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 200,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 280,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 360,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ orentation = new QComboBox( this ); ++ orentation->setGeometry( 130, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( fetch_scroll_orentation, orentation ); ++ ++ l_orentation = new QLabel( "FetchOrentation:", this ); ++ l_orentation->setGeometry( 10, 80, 120, 20 ); ++ ++ offset = new QLineEdit( this ); ++ offset->setGeometry( 130, 110, 70, 20 ); ++ offset->setMaxLength( 6 ); ++ offset->setText( "1" ); ++ ++ l_offset = new QLabel( "FetchOffset:", this ); ++ l_offset->setGeometry( 10, 110, 120, 20 ); ++ ++ count_ptr_valid = new QCheckBox( "RowCountPtr: VALID", this ); ++ count_ptr_valid->setGeometry( 10, 140, 300, 15 ); ++ ++ status_ptr_valid = new QCheckBox( "RowStatusArray: VALID", this ); ++ status_ptr_valid->setGeometry( 10, 170, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ ++ connect( count_ptr_valid, SIGNAL( clicked()), this, SLOT( count_ptr_clkd())); ++ connect( status_ptr_valid, SIGNAL( clicked()), this, SLOT( status_ptr_clkd())); ++} ++ ++dExtendedFetch::~dExtendedFetch() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete orentation; ++ delete offset; ++ delete l_handle; ++ delete l_orentation; ++ delete l_offset; ++ delete count_ptr_valid; ++ delete status_ptr_valid; ++} ++ ++void dSetScrollOptions::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLUSMALLINT fConcurrency, crowRowset; ++ SQLINTEGER crowKeyset; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLSetScrollOptions():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = concurrency->currentIndex(); ++ ++ fConcurrency = set_scroll_cur_operation[ index ].value; ++ txt.sprintf( " fConcurrency: %s=%d", set_scroll_cur_operation[ index ].text, ++ set_scroll_cur_operation[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = keyset ->currentIndex(); ++ ++ crowKeyset = set_scroll_ks_values[ index ].value; ++ txt.sprintf( " crowKeyset: %s=%d", set_scroll_ks_values[ index ].text, ++ set_scroll_ks_values[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ crowRowset = rowset->text().toInt(); ++ txt.sprintf( " crowRowset: %d", crowRowset ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetScrollOptions( in_handle, fConcurrency, crowKeyset, crowRowset ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( crowRowset < 1 ) ++ crowRowset = 1; ++ hand->row_array_size = crowRowset; ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetScrollOptions::dSetScrollOptions( OdbcTest *pOdbcTest, QString name ) ++: QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 200,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 280,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 360,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ concurrency = new QComboBox( this ); ++ concurrency->setGeometry( 130, 80, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( set_scroll_cur_operation, concurrency ); ++ ++ l_concurrency = new QLabel( "fConcurrency:", this ); ++ l_concurrency->setGeometry( 10, 80, 120, 20 ); ++ ++ keyset = new QComboBox( this ); ++ keyset->setGeometry( 130, 110, 300, 20 ); ++ ++ pOdbcTest->fill_list_box( set_scroll_ks_values, keyset ); ++ ++ l_keyset = new QLabel( "crowKeyset:", this ); ++ l_keyset->setGeometry( 10, 110, 120, 20 ); ++ ++ rowset = new QLineEdit( this ); ++ rowset->setGeometry( 130, 140, 70, 20 ); ++ rowset->setMaxLength( 6 ); ++ rowset->setText( "1" ); ++ ++ l_rowset = new QLabel( "crowRowset:", this ); ++ l_rowset->setGeometry( 10, 140, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dSetScrollOptions::~dSetScrollOptions() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete concurrency; ++ delete keyset; ++ delete l_handle; ++ delete l_concurrency; ++ delete l_keyset; ++ delete rowset; ++ delete l_rowset; ++} ++ ++void OdbcTest::slotBindCol() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotBulkOperations() ++{ ++ dBulkOperations *dlg = new dBulkOperations( this, "SQLBulkOperations" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotColAttribute() ++{ ++ dColAttribute *dlg = new dColAttribute( this, "SQLColAttribute" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotColAttributes() ++{ ++ dColAttributes *dlg = new dColAttributes( this, "SQLColAttributes" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDescribeCol() ++{ ++ dDescribeCol *dlg = new dDescribeCol( this, "SQLDescribeCol" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotExtendedFetch() ++{ ++ dExtendedFetch *dlg = new dExtendedFetch( this, "SQLExtendedFetch" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFetch() ++{ ++ dFetch *dlg = new dFetch( this, "SQLFetch" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFetchScroll() ++{ ++ dFetchScroll *dlg = new dFetchScroll( this, "SQLFetchScroll" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetData() ++{ ++ dGetData *dlg = new dGetData( this, "SQLGetData" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotMoreResults() ++{ ++ dMoreResults *dlg = new dMoreResults( this, "SQLMoreResults" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotNumResultCols() ++{ ++ dNumResultCols *dlg = new dNumResultCols( this, "SQLNumResultCols" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotRowCount() ++{ ++ dRowCount *dlg = new dRowCount( this, "SQLRowCount" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetPos() ++{ ++ dSetPos *dlg = new dSetPos( this, "SQLSetPos" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetScrollOptions() ++{ ++ dSetScrollOptions *dlg = new dSetScrollOptions( this, "SQLSetScrollOptions" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotBindColAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotDescribeColAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotFetchAll() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::getDataStmt( SQLHANDLE hstmt ) ++{ ++ SQLRETURN ret; ++ SQLSMALLINT column_count; ++ struct column_info ++ { ++ SQLCHAR column_name[ 128 ]; ++ SQLSMALLINT data_type; ++ SQLULEN column_size; ++ SQLCHAR column_buffer[ 64 ]; ++ SQLLEN str_len; ++ }; ++ int i; ++ int line_count; ++ ++ if ( !hstmt ) ++ { ++ return; ++ } ++ ++ /* ++ * Get number of columns ++ */ ++ ++ ret = SQLNumResultCols( hstmt, &column_count ); ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ dumpError( SQL_HANDLE_STMT, hstmt ); ++ out_win->append( "SQLNumResultCols() failed\n" ); ++ return; ++ } ++ ++ if ( column_count < 1 ) ++ { ++ out_win->append( "No result columns\n" ); ++ return; ++ } ++ ++ /* ++ * get column names and types ++ */ ++ ++ struct column_info *col_info = new struct column_info[ column_count ]; ++ ++ for ( i = 0; i < column_count; i ++ ) ++ { ++ ret = SQLDescribeCol( hstmt, i + 1, ++ col_info[ i ].column_name, sizeof( col_info[ i ].column_name ), ++ NULL, &col_info[ i ].data_type, &col_info[ i ].column_size, ++ NULL, NULL ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ dumpError( SQL_HANDLE_STMT, hstmt ); ++ out_win->append( "SQLDescribeCol() failed\n" ); ++ delete col_info; ++ return; ++ } ++ } ++ ++ /* ++ * output buffer ++ */ ++ ++ char *line = new char[ column_count * ( sizeof( col_info[ i ].column_name ) + 1 )]; ++ ++ line[ 0 ] = '\0'; ++ for ( i = 0; i < column_count; i ++ ) ++ { ++ if ( i > 0 ) ++ strcat( line, ":" ); ++ strcat( line, (char *)col_info[ i ].column_name ); ++ } ++ ++ out_win->append( line ); ++ ++ /* ++ * get the data ++ */ ++ ++ line_count = 0; ++ ++ while ( SQL_SUCCEEDED( ret = SQLFetch( hstmt ))) ++ { ++ line_count ++; ++ line[ 0 ] = '\0'; ++ ++ for ( i = 0; i < column_count; i ++ ) ++ { ++ ret = SQLGetData( hstmt, i + 1, ++ SQL_C_CHAR, col_info[ i ].column_buffer, ++ sizeof( col_info[ i ].column_buffer ), ++ &col_info[ i ].str_len ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ dumpError( SQL_HANDLE_STMT, hstmt ); ++ out_win->append( "SQLGetData() failed\n" ); ++ delete line; ++ delete col_info; ++ return; ++ } ++ ++ if ( i > 0 ) ++ strcat( line, ":" ); ++ ++ if ( col_info[ i ].str_len < 0 ) ++ { ++ strcat( line, "NULL" ); ++ } ++ else ++ { ++ strcat( line, (char*)col_info[ i ].column_buffer ); ++ } ++ } ++ out_win->append( line ); ++ } ++ ++ if ( ret != SQL_NO_DATA ) ++ { ++ dumpError( SQL_HANDLE_STMT, hstmt ); ++ out_win->append( "SQLFetch() failed\n" ); ++ delete line; ++ delete col_info; ++ return; ++ } ++ ++ /* ++ * Eat any trunc errors ++ */ ++ ++ do ++ { ++ SQLINTEGER native; ++ SQLCHAR sqlstate[ 6 ]; ++ SQLCHAR msg[ SQL_MAX_MESSAGE_LENGTH ]; ++ ++ ret = SQLError( SQL_NULL_HENV, SQL_NULL_HDBC, hstmt, ++ sqlstate, &native, msg, sizeof( msg ), NULL ); ++ } ++ while ( SQL_SUCCEEDED( ret )); ++ ++ /* ++ * close off the cursor ++ */ ++ ++ ret = SQLCloseCursor( hstmt ); ++ ++ if ( !SQL_SUCCEEDED( ret )) ++ { ++ dumpError( SQL_HANDLE_STMT, hstmt ); ++ out_win->append( "SQLCloseCursor() failed\n" ); ++ delete line; ++ delete col_info; ++ return; ++ } ++ ++ sprintf( line, "%d Line(s) Fetched\n", line_count ); ++ out_win->append( line ); ++ ++ delete line; ++ delete col_info; ++} ++ ++void OdbcTest::slotGetDataAll() ++{ ++ /* ++ * look for a statement handle ++ */ ++ ++ SQLHANDLE hstmt = NULL; ++ int handle_count = 0; ++ char txt[ 128 ]; ++ ++ ++ QListIterator i( listHandle ); ++ ++ while ( i.hasNext() ) ++ { ++ OdbcHandle *hand = i.next(); ++ if ( !hand ) ++ break; ++ hand->toStr( txt ); ++ if ( hand->getType() == SQL_HANDLE_STMT ) ++ { ++ handle_count ++; ++ hstmt = hand->getHandle(); ++ } ++ } ++ ++ if ( handle_count == 0 ) ++ { ++ QMessageBox::about( this, "Get Data All", ++ "No statement handles avalable" ); ++ } ++ else if ( handle_count == 1 ) ++ { ++ getDataStmt( hstmt ); ++ } ++ else ++ { ++ getDataStmt(); ++ } ++} ++ ++void OdbcTest::slotShowBoundCols() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotDisplayRowSet() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ +diff --git a/unixODBC-2.3.7/tests/results.h b/unixODBC-2.3.7/tests/results.h +new file mode 100644 +index 0000000..b9c988b +--- /dev/null ++++ b/unixODBC-2.3.7/tests/results.h +@@ -0,0 +1,349 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dGetData : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetData( OdbcTest *pOdbcTest, QString name ); ++ ~dGetData(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *type; ++ QLineEdit *column_num; ++ QLineEdit *buffer_len; ++ QCheckBox *target_valid, *strlen_valid; ++ QLabel *l_handle, *l_column_num, *l_type, *l_buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void target_clkd(); ++ void strlen_clkd(); ++ void Ok(); ++}; ++ ++class dDescribeCol : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dDescribeCol( OdbcTest *pOdbcTest, QString name ); ++ ~dDescribeCol(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLineEdit *column_num; ++ QLineEdit *column_len; ++ QLabel *l_handle, *l_column_num, *l_column_len; ++ QCheckBox *name_valid; ++ QCheckBox *type_valid; ++ QCheckBox *size_valid; ++ QCheckBox *digit_valid; ++ QCheckBox *null_valid; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ const char *data_type_to_str( int ); ++ ++ protected slots: ++ void name_clkd(); ++ void type_clkd(); ++ void size_clkd(); ++ void digit_clkd(); ++ void null_clkd(); ++ void Ok(); ++}; ++ ++class dNumResultCols : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dNumResultCols( OdbcTest *pOdbcTest, QString name ); ++ ~dNumResultCols(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QCheckBox *valid; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void out_handle_ptr_clkd(); ++ void Ok(); ++}; ++ ++class dFetch : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dFetch( OdbcTest *pOdbcTest, QString name ); ++ ~dFetch(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dRowCount : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dRowCount( OdbcTest *pOdbcTest, QString name ); ++ ~dRowCount(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QCheckBox *valid; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void Valid(); ++}; ++ ++class dMoreResults : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dMoreResults( OdbcTest *pOdbcTest, QString name ); ++ ~dMoreResults(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dSetPos : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetPos( OdbcTest *pOdbcTest, QString name ); ++ ~dSetPos(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *operation, *lock_type; ++ QLabel *l_handle, *l_operation, *l_lock_type, *l_row_number; ++ QLineEdit *row_number; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dBulkOperations : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dBulkOperations( OdbcTest *pOdbcTest, QString name ); ++ ~dBulkOperations(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *operation; ++ QLabel *l_handle, *l_operation; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dColAttribute : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dColAttribute( OdbcTest *pOdbcTest, QString name ); ++ ~dColAttribute(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *field_ident; ++ QLabel *l_handles, *l_buffer_len, *l_col_num, *l_diag_info; ++ QLabel *l_field_ident; ++ QCheckBox *char_ptr_valid, *strlen_valid, *numeric_valid; ++ QLineEdit *buffer_len, *col_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void char_ptr_clkd(); ++ void strlen_clkd(); ++ void numeric_clkd(); ++}; ++ ++class dColAttributes : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dColAttributes( OdbcTest *pOdbcTest, QString name ); ++ ~dColAttributes(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *field_ident; ++ QLabel *l_handles, *l_buffer_len, *l_col_num, *l_diag_info; ++ QLabel *l_field_ident; ++ QCheckBox *char_ptr_valid, *strlen_valid, *numeric_valid; ++ QLineEdit *buffer_len, *col_num; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void char_ptr_clkd(); ++ void strlen_clkd(); ++ void numeric_clkd(); ++}; ++ ++class dFetchScroll : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dFetchScroll( OdbcTest *pOdbcTest, QString name ); ++ ~dFetchScroll(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *orentation; ++ QLabel *l_handle, *l_orentation, *l_offset; ++ QLineEdit *offset; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dExtendedFetch : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dExtendedFetch( OdbcTest *pOdbcTest, QString name ); ++ ~dExtendedFetch(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *orentation; ++ QLabel *l_handle, *l_orentation, *l_offset; ++ QLineEdit *offset; ++ QTextEdit *in_win; ++ QCheckBox *count_ptr_valid, *status_ptr_valid; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void count_ptr_clkd(); ++ void status_ptr_clkd(); ++}; ++ ++class dSetScrollOptions : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetScrollOptions( OdbcTest *pOdbcTest, QString name ); ++ ~dSetScrollOptions(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *concurrency, *keyset; ++ QLabel *l_handle, *l_concurrency, *l_keyset, *l_rowset; ++ QLineEdit *rowset; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++ +diff --git a/unixODBC-2.3.7/tests/stmt.cpp b/unixODBC-2.3.7/tests/stmt.cpp +new file mode 100644 +index 0000000..de888b1 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/stmt.cpp +@@ -0,0 +1,2262 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#include "stmt.h" ++#include "OdbcTest.h" ++ ++static attr_value io_type_option[] = ++{ ++ { "SQL_PARAM_INPUT", SQL_PARAM_INPUT, "2.0", 0 }, ++ { "SQL_PARAM_INPUT_OUTPUT", SQL_PARAM_INPUT_OUTPUT, "2.0", 0 }, ++ { "SQL_PARAM_INPUT", SQL_PARAM_OUTPUT, "2.0", 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++static attr_value value_type_option[] = ++{ ++ { "SQL_C_CHAR", SQL_C_CHAR, "1.0", 0 }, ++ { "SQL_C_BINARY", SQL_C_BINARY, "1.0", 0 }, ++ { "SQL_C_BIT", SQL_C_BIT, "1.0", 0 }, ++ { "SQL_C_BOOKMARK", SQL_C_BOOKMARK, "2.0", 0 }, ++ { "SQL_C_DATE", SQL_C_DATE, "1.0", 0 }, ++ { "SQL_C_DOUBLE", SQL_C_DOUBLE, "1.0", 0 }, ++ { "SQL_C_FLOAT", SQL_C_FLOAT, "1.0", 0 }, ++ { "SQL_C_GUID", SQL_C_GUID, "1.0", 0 }, ++ { "SQL_C_INTERVAL_DAY", SQL_C_INTERVAL_DAY, "3.0", 0 }, ++ { "SQL_C_INTERVAL_DAY_TO_HOUR", SQL_C_INTERVAL_DAY_TO_HOUR, "3.0", 0 }, ++ { "SQL_C_INTERVAL_DAY_TO_MINUTE", SQL_C_INTERVAL_DAY_TO_MINUTE, "3.0", 0 }, ++ { "SQL_C_INTERVAL_DAY_TO_SECOND", SQL_C_INTERVAL_DAY_TO_SECOND, "3.0", 0 }, ++ { "SQL_C_INTERVAL_HOUR", SQL_C_INTERVAL_HOUR, "3.0", 0 }, ++ { "SQL_C_INTERVAL_HOUR_TO_MINUTE", SQL_C_INTERVAL_HOUR_TO_MINUTE, "3.0", 0 }, ++ { "SQL_C_INTERVAL_HOUR_TO_SECOND", SQL_C_INTERVAL_HOUR_TO_SECOND, "3.0", 0 }, ++ { "SQL_C_INTERVAL_MINUTE", SQL_C_INTERVAL_MINUTE, "3.0", 0 }, ++ { "SQL_C_INTERVAL_MINUTE_TO_SECOND", SQL_C_INTERVAL_MINUTE_TO_SECOND, "3.0", 0 }, ++ { "SQL_C_INTERVAL_SECOND", SQL_C_INTERVAL_SECOND, "3.0", 0 }, ++ { "SQL_C_INTERVAL_YEAR", SQL_C_INTERVAL_YEAR, "3.0", 0 }, ++ { "SQL_C_INTERVAL_MONTH", SQL_C_INTERVAL_MONTH, "3.0", 0 }, ++ { "SQL_C_INTERVAL_YEAR_TO_MONTH", SQL_C_INTERVAL_YEAR_TO_MONTH, "3.0", 0 }, ++ { "SQL_C_LONG", SQL_C_LONG, "2.0", 0 }, ++ { "SQL_C_NUMERIC", SQL_C_NUMERIC, "3.0", 0 }, ++ { "SQL_C_SBIGINT", SQL_C_SBIGINT, "3.0", 0 }, ++ { "SQL_C_SLONG", SQL_C_SLONG, "2.0", 0 }, ++ { "SQL_C_SHORT", SQL_C_SHORT, "2.0", 0 }, ++ { "SQL_C_SSHORT", SQL_C_SSHORT, "2.0", 0 }, ++ { "SQL_C_STINYINT", SQL_C_STINYINT, "2.0", 0 }, ++ { "SQL_C_TIME", SQL_C_TIME, "1.0", 0 }, ++ { "SQL_C_TIMESTAMP", SQL_C_TIMESTAMP, "1.0", 0 }, ++ { "SQL_C_TINYINT", SQL_C_TINYINT, "1.0", 0 }, ++ { "SQL_C_TYPE_DATE", SQL_C_TYPE_DATE, "3.0", 0 }, ++ { "SQL_C_TYPE_TIME", SQL_C_TYPE_TIME, "3.0", 0 }, ++ { "SQL_C_TYPE_TIMESTAMP", SQL_C_TYPE_TIMESTAMP, "3.0", 0 }, ++ { "SQL_C_UBIGINT", SQL_C_UBIGINT, "2.0", 0 }, ++ { "SQL_C_USHORT", SQL_C_USHORT, "2.0", 0 }, ++ { "SQL_C_UTINYINT", SQL_C_UTINYINT, "2.0", 0 }, ++ { "SQL_C_VARBOOKMARK", SQL_C_VARBOOKMARK, "3.0", 0 }, ++ { "SQL_C_WCHAR", SQL_C_WCHAR, "3.0", 0 }, ++ { "SQL_ARD_TYPE", SQL_ARD_TYPE, "3.0", 0 }, ++ { "SQL_C_DEFAULT", SQL_C_DEFAULT, "1.0", 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++static attr_value param_type_option[] = ++{ ++ { "SQL_CHAR", SQL_CHAR, "1.0", 0 }, ++ { "SQL_BIGINT", SQL_BIGINT, "1.0", 0 }, ++ { "SQL_BINARY", SQL_BINARY, "1.0", 0 }, ++ { "SQL_BIT", SQL_BIT, "1.0", 0 }, ++ { "SQL_DATE", SQL_DATE, "1.0", 0 }, ++ { "SQL_DECIMAL", SQL_DECIMAL, "1.0", 0 }, ++ { "SQL_DEFAULT", SQL_DECIMAL, "3.0", 0 }, ++ { "SQL_DOUBLE", SQL_DOUBLE, "1.0", 0 }, ++ { "SQL_FLOAT", SQL_FLOAT, "1.0", 0 }, ++ { "SQL_GUID", SQL_GUID, "1.0", 0 }, ++ { "SQL_INTEGER", SQL_INTEGER, "1.0", 0 }, ++ { "SQL_INTERVAL_DAY", SQL_INTERVAL_DAY, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_HOUR", SQL_INTERVAL_DAY_TO_HOUR, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_MINUTE", SQL_INTERVAL_DAY_TO_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_SECOND", SQL_INTERVAL_DAY_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR", SQL_INTERVAL_HOUR, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR_TO_MINUTE", SQL_INTERVAL_HOUR_TO_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR_TO_SECOND", SQL_INTERVAL_HOUR_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_MINUTE", SQL_INTERVAL_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_MINUTE_TO_SECOND", SQL_INTERVAL_MINUTE_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_SECOND", SQL_INTERVAL_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_YEAR", SQL_INTERVAL_YEAR, "3.0", 0 }, ++ { "SQL_INTERVAL_MONTH", SQL_INTERVAL_MONTH, "3.0", 0 }, ++ { "SQL_INTERVAL_YEAR_TO_MONTH", SQL_INTERVAL_YEAR_TO_MONTH, "3.0", 0 }, ++ { "SQL_LONGVARCHAR", SQL_LONGVARCHAR, "1.0", 0 }, ++ { "SQL_LONGVARBINARY", SQL_LONGVARBINARY, "1.0", 0 }, ++ { "SQL_NUMERIC", SQL_NUMERIC, "1.0", 0 }, ++ { "SQL_REAL", SQL_REAL, "1.0", 0 }, ++ { "SQL_SMALLINT", SQL_SMALLINT, "1.0", 0 }, ++ { "SQL_TINYINT", SQL_TINYINT, "1.0", 0 }, ++ { "SQL_TIME", SQL_TIME, "1.0", 0 }, ++ { "SQL_TIMESTAMP", SQL_TIMESTAMP, "1.0", 0 }, ++ { "SQL_TYPE_DATE", SQL_TYPE_DATE, "3.0", 0 }, ++ { "SQL_TYPE_TIME", SQL_TYPE_TIME, "3.0", 0 }, ++ { "SQL_TYPE_TIMESTAMP", SQL_TYPE_TIMESTAMP, "3.0", 0 }, ++ { "SQL_VARBINARY", SQL_VARBINARY, "1.0", 0 }, ++ { "SQL_VARCHAR", SQL_VARCHAR, "1.0", 0 }, ++ { "SQL_WCHAR", SQL_WCHAR, "3.0", 0 }, ++ { "SQL_WLONGVARCHAR", SQL_WLONGVARCHAR, "3.0", 0 }, ++ { "SQL_WVARCHAR", SQL_WVARCHAR, "3.0", 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++static attr_value free_stmt_option[] = ++{ ++ { "SQL_CLOSE", SQL_CLOSE, NULL, 0 }, ++ { "SQL_DROP", SQL_DROP, NULL, 0 }, ++ { "SQL_UNBIND", SQL_UNBIND, NULL, 0 }, ++ { "SQL_RESET_PARAMS", SQL_RESET_PARAMS, NULL, 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++static attr_value sql_data_types[] = ++{ ++ { "SQL_CHAR", SQL_CHAR, "1.0", 0 }, ++ { "SQL_VARCHAR", SQL_VARCHAR, "1.0", 0 }, ++ { "SQL_LONGVARCHAR", SQL_LONGVARCHAR, "1.0", 0 }, ++ { "SQL_BINARY", SQL_BINARY, "1.0", 0 }, ++ { "SQL_VARBINARY", SQL_VARBINARY, "1.0", 0 }, ++ { "SQL_LONGVARBINARY", SQL_LONGVARBINARY, "1.0", 0 }, ++ { "SQL_TINYINT", SQL_TINYINT, "1.0", 0 }, ++ { "SQL_SMALLINT", SQL_SMALLINT, "1.0", 0 }, ++ { "SQL_INTEGER", SQL_INTEGER, "1.0", 0 }, ++ { "SQL_BIGINT", SQL_BIGINT, "1.0", 0 }, ++ { "SQL_FLOAT", SQL_FLOAT, "1.0", 0 }, ++ { "SQL_DOUBLE", SQL_DOUBLE, "1.0", 0 }, ++ { "SQL_REAL", SQL_REAL, "1.0", 0 }, ++ { "SQL_NUMERIC", SQL_NUMERIC, "1.0", 0 }, ++ { "SQL_DATETIME", SQL_DATETIME, "1.0", 0 }, ++ { "SQL_DATE", SQL_DATE, "1.0", 0 }, ++ { "SQL_TIME", SQL_TIME, "1.0", 0 }, ++ { "SQL_TIMESTAMP", SQL_TIMESTAMP, "1.0", 0 }, ++ { "SQL_INTERVAL_DAY", SQL_INTERVAL_DAY, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_HOUR", SQL_INTERVAL_DAY_TO_HOUR, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_MINUTE", SQL_INTERVAL_DAY_TO_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_DAY_TO_SECOND", SQL_INTERVAL_DAY_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR", SQL_INTERVAL_HOUR, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR_TO_MINUTE", SQL_INTERVAL_HOUR_TO_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_HOUR_TO_SECOND", SQL_INTERVAL_HOUR_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_MINUTE_TO_SECOND", SQL_INTERVAL_MINUTE_TO_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_MONTH", SQL_INTERVAL_MONTH, "3.0", 0 }, ++ { "SQL_INTERVAL_MINUTE", SQL_INTERVAL_MINUTE, "3.0", 0 }, ++ { "SQL_INTERVAL_SECOND", SQL_INTERVAL_SECOND, "3.0", 0 }, ++ { "SQL_INTERVAL_YEAR", SQL_INTERVAL_YEAR, "3.0", 0 }, ++ { "SQL_INTERVAL_YEAR_TO_MONTH", SQL_INTERVAL_YEAR_TO_MONTH, "3.0", 0 }, ++ { "SQL_GUID", SQL_GUID, "3.0", 0 }, ++ { NULL, 0, NULL, 0 } ++}; ++ ++void dPrepare::Ok() ++{ ++ const char *sql, *lname; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLINTEGER n_len; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ sql = str->currentText().toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLPrepare():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sql, "" ) == 0 ) ++ { ++ sql = NULL; ++ pOdbcTest->out_win->append( " Text: " ); ++ } ++ else if ( strcmp( sql, "" ) == 0 ) ++ { ++ sql = ""; ++ pOdbcTest->out_win->append( " Text: " ); ++ } ++ else if ( strcmp( sql, "" ) == 0 ) ++ { ++ QString *s = new QString( pOdbcTest->in_win->toPlainText() ); ++ if ( s->isEmpty()) ++ sql = ""; ++ else if ( s->isNull()) ++ sql = NULL; ++ else ++ sql = s->toUtf8().constData(); ++ txt.sprintf( " Text: %s", sql ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " Text: %s", sql ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ lname = name_len->currentText().toUtf8().constData(); ++ ++ if ( strncmp( lname, "SQL_NTS", 7 ) == 0 ) ++ { ++ n_len = SQL_NTS; ++ txt.sprintf( " Statement Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ n_len = atoi( lname ); ++ txt.sprintf( " Statement Len: %d", n_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLPrepare( in_handle, (SQLCHAR*) sql, n_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dPrepare::dPrepare( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ str = new QComboBox( this ); ++ str->setEditable( true ); ++ str->setGeometry( 130, 80, 290, 20 ); ++ str->insertItem( 0, "" ); ++ str->insertItem( 1, "" ); ++ str->insertItem( 2, "" ); ++ ++ name_len = new QComboBox( this ); ++ name_len->setEditable( true ); ++ name_len->setGeometry( 130, 110, 150, 20 ); ++ l_name_len = new QLabel( "Statement Length:", this ); ++ l_name_len->setGeometry( 10, 110, 110, 20 ); ++ name_len->insertItem( 0, "SQL_NTS=-3" ); ++ name_len->insertItem( 1, "0" ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ l_str = new QLabel( "SQL Text:", this ); ++ l_str->setGeometry( 10, 80, 70, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dPrepare::~dPrepare() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete str; ++ delete l_handle; ++ delete l_str; ++ delete name_len; ++ delete l_name_len; ++} ++ ++void dExecute::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLExecute():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLExecute( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dExecute::dExecute( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 190, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dExecute::~dExecute() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++} ++ ++void dExecDirect::Ok() ++{ ++ /* ++ * Get handle... ++ */ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE hStatement = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ hStatement = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLExecDirect():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( hStatement ) ++ pOdbcTest->out_win->append( QString( tr(" Statement Handle: %1") ).arg( (qlonglong)hStatement ) ); ++ else ++ pOdbcTest->out_win->append( " Statement Handle: SQL_NULL_HSTMT" ); ++ ++ /* ++ * Get User provided SQL... ++ */ ++ QString stringSQL = str->currentText(); ++// SQLTCHAR * pszSQL = NULL; ++ ++ if ( stringSQL == "" || stringSQL.isNull() ) ++ { ++ stringSQL.clear(); // pszSQL = NULL; ++ pOdbcTest->out_win->append( " Text: " ); ++ } ++ else if ( stringSQL == "" || stringSQL.isEmpty() ) ++ { ++ stringSQL = ""; // pszSQL = OtStringToPlatform( s ); ++ pOdbcTest->out_win->append( " Text: " ); ++ } ++ else ++ { ++ if ( stringSQL == "" ) ++ stringSQL = pOdbcTest->in_win->toPlainText(); ++/* ++ if ( stringSQL.isNull()) ++ pszSQL = NULL; ++ else if ( stringSQL.isEmpty()) ++ pszSQL = TEXT(""); ++ else ++ pszSQL = OtStringToPlatform( stringSQL ); ++*/ ++ pOdbcTest->out_win->append( " Text: " + stringSQL ); // pOdbcTest->out_win->append( " Text: " + OtStringFromPlatform( pszSQL ) ); ++ } ++ ++ /* ++ * Get User provided length... ++ */ ++ QString stringLength = name_len->currentText(); ++ SQLINTEGER nSQL = SQL_NTS; ++ ++ if ( stringLength.left( 7 ) == "SQL_NTS" ) ++ { ++ nSQL = SQL_NTS; ++ pOdbcTest->out_win->append( tr(" Statement Len: SQL_NTS=-3") ); ++ } ++ else ++ { ++ nSQL = stringLength.toInt(); ++ pOdbcTest->out_win->append( QString( tr(" Statement Len: %1") ).arg( nSQL ) ); ++ } ++ ++ /* ++ * Execute SQL... ++ */ ++ SQLRETURN nReturn = SQLExecDirect( hStatement, OtStringToPlatform(stringSQL), nSQL ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ pOdbcTest->out_win->append( QString( " %1=%2" ).arg( pOdbcTest->return_as_text( nReturn ) ).arg( nReturn ) ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dExecDirect::dExecDirect( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ str = new QComboBox( this ); ++ str->setEditable( true ); ++ str->setGeometry( 130, 80, 290, 20 ); ++ str->insertItem( 0, "" ); ++ str->insertItem( 1, "" ); ++ str->insertItem( 2, "" ); ++ ++ name_len = new QComboBox( this ); ++ name_len->setEditable( true ); ++ name_len->setGeometry( 130, 110, 150, 20 ); ++ l_name_len = new QLabel( "Statement Length:", this ); ++ l_name_len->setGeometry( 10, 110, 110, 20 ); ++ name_len->insertItem( 0, "SQL_NTS=-3" ); ++ name_len->insertItem( 1, "0" ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ l_str = new QLabel( "SQL Text:", this ); ++ l_str->setGeometry( 10, 80, 70, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dExecDirect::~dExecDirect() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete str; ++ delete l_handle; ++ delete l_str; ++ delete name_len; ++ delete l_name_len; ++} ++ ++void dNumParams::Valid() ++{ ++ if ( valid->isChecked() ) ++ valid->setText( "ParamCountPtr: SQL_NULL_POINTER" ); ++ else ++ valid->setText( "ParamCountPtr: VALID" ); ++} ++ ++void dNumParams::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT num_params; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLNumParam:" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( valid->isChecked() ) ++ txt.sprintf( " ParamCountPtr: " ); ++ else ++ txt.sprintf( " ParamCountPtr: %p", &num_params ); ++ pOdbcTest->out_win->append( txt ); ++ ++ num_params = -9999; ++ ++ SQLRETURN ret = SQLNumParams( in_handle, valid->isChecked() ? NULL : &num_params ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ if ( num_params == -9999 ) ++ { ++ txt.sprintf( " *ParamCountPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *ParamCountPtr: %d", num_params ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dNumParams::dNumParams( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ valid = new QCheckBox( "ParamCountPtr: VALID", this ); ++ valid->setGeometry( 10, 80, 300, 15 ); ++ ++ connect( valid, SIGNAL( clicked()), this, SLOT( Valid())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dNumParams::~dNumParams() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete valid; ++} ++ ++void dCancel::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLCancel():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLCancel( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dCancel::dCancel( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dCancel::~dCancel() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++} ++ ++void dCloseCursor::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLCloseCursor():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLCloseCursor( in_handle ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dCloseCursor::dCloseCursor( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dCloseCursor::~dCloseCursor() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++} ++ ++void dGetCursorName::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLSMALLINT b_len; ++ SQLCHAR *buf; ++ SQLSMALLINT name_length, *name_length_ptr; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLGetCursorName():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ b_len = buffer_len->text().toInt(); ++ if ( b_len < 1 ) ++ { ++ b_len = 0; ++ } ++ ++ if ( cursor_valid->isChecked()) ++ { ++ buf = NULL; ++ } ++ else if ( b_len < 300 ) ++ { ++ buf = new SQLCHAR[ 300 ]; ++ } ++ else ++ { ++ buf = new SQLCHAR[ b_len ]; ++ } ++ ++ if ( buf ) ++ { ++ txt.sprintf( " CursorName: %p", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " CursorName: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ txt.sprintf( " Buffer Length: %d", b_len ); ++ pOdbcTest->out_win->append( txt ); ++ ++ name_length = -9999; ++ ++ if ( name_valid->isChecked()) ++ { ++ name_length_ptr = NULL; ++ } ++ else ++ { ++ name_length_ptr = &name_length; ++ } ++ ++ if ( name_length_ptr ) ++ { ++ txt.sprintf( " NameLengthPtr: %p", name_length_ptr ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " NameLengthPtr: SQL_NULL_POINTER" ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ SQLRETURN ret = SQLGetCursorName( in_handle, buf, b_len, name_length_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( buf ) ++ { ++ txt.sprintf( " *CursorName: \"%s\"", buf ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ if ( name_length == -9999 ) ++ { ++ txt.sprintf( " *NameLengthPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NameLengthPtr: %d", name_length ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( buf ) ++ delete buf; ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++void dGetCursorName::NameValid() ++{ ++ if ( name_valid->isChecked() ) ++ name_valid->setText( "NameLengthPtr: SQL_NULL_POINTER" ); ++ else ++ name_valid->setText( "NameLengthPtr: VALID" ); ++} ++ ++void dGetCursorName::CursorValid() ++{ ++ if ( cursor_valid->isChecked() ) ++ cursor_valid->setText( "CursorName: SQL_NULL_POINTER" ); ++ else ++ cursor_valid->setText( "CursorName: VALID" ); ++} ++ ++dGetCursorName::dGetCursorName( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ cursor_valid = new QCheckBox( "CursorName: VALID", this ); ++ cursor_valid->setGeometry( 10, 80, 300, 15 ); ++ ++ name_valid = new QCheckBox( "NameLengthPtr: VALID", this ); ++ name_valid->setGeometry( 10, 110, 300, 15 ); ++ ++ buffer_len = new QLineEdit( this ); ++ buffer_len->setGeometry( 350, 80, 70, 20 ); ++ buffer_len->setMaxLength( 6 ); ++ buffer_len->setText( "300" ); ++ ++ l_buffer_len = new QLabel( "Buffer Len:", this ); ++ l_buffer_len->setGeometry( 270, 80, 60, 20 ); ++ ++ connect( cursor_valid, SIGNAL( clicked()), this, SLOT( CursorValid())); ++ connect( name_valid, SIGNAL( clicked()), this, SLOT( NameValid())); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dGetCursorName::~dGetCursorName() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete l_buffer_len; ++ delete buffer_len; ++ delete name_valid; ++ delete cursor_valid; ++} ++ ++void dFreeStmt::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLUSMALLINT option_val; ++ int index; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLFreeStmt():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ index = option->currentIndex(); ++ ++ option_val = free_stmt_option[ index ].value; ++ txt.sprintf( " Option: %s=%d", free_stmt_option[ index ].text, ++ free_stmt_option[ index ].value ); ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLFreeStmt( in_handle, option_val ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && free_stmt_option[ index ].value == SQL_DROP ) ++ { ++ pOdbcTest->listHandle.removeAll( hand ); ++ delete hand; ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dFreeStmt::dFreeStmt( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ option = new QComboBox( this ); ++ option->setGeometry( 130, 80, 200, 20 ); ++ ++ pOdbcTest->fill_list_box( free_stmt_option, option ); ++ ++ l_option = new QLabel( "Option:", this ); ++ l_option->setGeometry( 10, 80, 120, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dFreeStmt::~dFreeStmt() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete option; ++ delete l_handle; ++ delete l_option; ++} ++ ++void dSetCursorName::Ok() ++{ ++ const char *sql, *lname; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLINTEGER n_len; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ sql = str->currentText().toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLSetCursorName():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( sql, "" ) == 0 ) ++ { ++ sql = NULL; ++ pOdbcTest->out_win->append( " CursorName: " ); ++ } ++ else if ( strcmp( sql, "" ) == 0 ) ++ { ++ sql = ""; ++ pOdbcTest->out_win->append( " CursorName: " ); ++ } ++ else if ( strcmp( sql, "" ) == 0 ) ++ { ++ QString *s = new QString( pOdbcTest->in_win->toPlainText() ); ++ if ( s->isEmpty()) ++ sql = ""; ++ else if ( s->isNull()) ++ sql = NULL; ++ else ++ sql = s->toUtf8().constData(); ++ txt.sprintf( " CursorName: %s", sql ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ txt.sprintf( " CursorName: %s", sql ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ lname = name_len->currentText().toUtf8().constData(); ++ ++ if ( strncmp( lname, "SQL_NTS", 7 ) == 0 ) ++ { ++ n_len = SQL_NTS; ++ txt.sprintf( " Statement Len: SQL_NTS=-3" ); ++ } ++ else ++ { ++ n_len = atoi( lname ); ++ txt.sprintf( " Statement Len: %d", n_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLSetCursorName( in_handle, (SQLCHAR*) sql, n_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dSetCursorName::dSetCursorName( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 190,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 270,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 350,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ str = new QComboBox( this ); ++ str->setEditable( true ); ++ str->setGeometry( 130, 80, 290, 20 ); ++ str->insertItem( 0, "" ); ++ str->insertItem( 1, "" ); ++ str->insertItem( 2, "" ); ++ ++ name_len = new QComboBox( this ); ++ name_len->setGeometry( 130, 110, 150, 20 ); ++ l_name_len = new QLabel( "CursorName Length:", this ); ++ l_name_len->setGeometry( 10, 110, 110, 20 ); ++ name_len->insertItem( 0, "SQL_NTS=-3" ); ++ name_len->insertItem( 1, "0" ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ l_str = new QLabel( "SQL Text:", this ); ++ l_str->setGeometry( 10, 80, 70, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dSetCursorName::~dSetCursorName() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete str; ++ delete l_handle; ++ delete l_str; ++ delete name_len; ++ delete l_name_len; ++} ++ ++const char *dDescribeParam::data_type_to_str( int type ) ++{ ++ struct attr_value *data_type = sql_data_types; ++ ++ while( TRUE ) ++ { ++ if ( !data_type->text ) ++ break; ++ ++ if ( data_type->value == type ) ++ break; ++ ++ data_type ++; ++ }; ++ ++ if ( data_type->text ) ++ return data_type->text; ++ else ++ return NULL; ++} ++ ++void dDescribeParam::type_clkd() ++{ ++ if ( type_valid->isChecked() ) ++ type_valid->setText( "DataTypePtr: SQL_NULL_PTR" ); ++ else ++ type_valid->setText( "DataTypePtr: VALID" ); ++} ++ ++void dDescribeParam::size_clkd() ++{ ++ if ( size_valid->isChecked() ) ++ size_valid->setText( "ParameterSizePtr: SQL_NULL_PTR" ); ++ else ++ size_valid->setText( "ParameterSizePtr: VALID" ); ++} ++ ++void dDescribeParam::digit_clkd() ++{ ++ if ( digit_valid->isChecked() ) ++ digit_valid->setText( "DecimalDigitsPtr: SQL_NULL_PTR" ); ++ else ++ digit_valid->setText( "DecimalDigitsPtr: VALID" ); ++} ++ ++void dDescribeParam::null_clkd() ++{ ++ if ( null_valid->isChecked() ) ++ null_valid->setText( "NullablePtr: SQL_NULL_PTR" ); ++ else ++ null_valid->setText( "NullablePtr: VALID" ); ++} ++ ++void dDescribeParam::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLUSMALLINT parameter_number; ++ SQLSMALLINT *data_type_ptr, data_type; ++ SQLULEN *param_size_ptr, param_size; ++ SQLSMALLINT *decimal_digits_ptr, decimal_digits; ++ SQLSMALLINT *nullable_ptr, nullable; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLDescribeParam():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ parameter_number = param_num->text().toInt(); ++ txt.sprintf( " Parameter Number: %d", parameter_number ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( type_valid->isChecked() ) ++ { ++ data_type_ptr = NULL; ++ txt.sprintf( " DataTypePtr: " ); ++ } ++ else ++ { ++ data_type_ptr = &data_type; ++ txt.sprintf( " DataTypePtr: %p", data_type_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ data_type = -9999; ++ ++ if ( size_valid->isChecked() ) ++ { ++ param_size_ptr = NULL; ++ txt.sprintf( " ParameterSizePtr: " ); ++ } ++ else ++ { ++ param_size_ptr = ¶m_size; ++ txt.sprintf( " ParameterSizePtr: %p", param_size_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ param_size = 9999; ++ ++ if ( digit_valid->isChecked() ) ++ { ++ decimal_digits_ptr = NULL; ++ txt.sprintf( " DecimalDigitsPtr: " ); ++ } ++ else ++ { ++ decimal_digits_ptr = &decimal_digits; ++ txt.sprintf( " DecimalDigitsPtr: %p", decimal_digits ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ decimal_digits = -9999; ++ ++ if ( null_valid->isChecked() ) ++ { ++ nullable_ptr = NULL; ++ txt.sprintf( " NullablePtr: " ); ++ } ++ else ++ { ++ nullable_ptr = &nullable; ++ txt.sprintf( " NullablePtr: %p", nullable_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ nullable = -9999; ++ ++ SQLRETURN ret = SQLDescribeParam( in_handle, ++ parameter_number, ++ data_type_ptr, ++ param_size_ptr, ++ decimal_digits_ptr, ++ nullable_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( data_type_ptr ) ++ { ++ if ( data_type == -9999 ) ++ { ++ txt.sprintf( " *DataTypePtr: " ); ++ } ++ else ++ { ++ const char *str = data_type_to_str( data_type ); ++ ++ if ( str ) ++ txt.sprintf( " *DataTypePtr: %s (%d)", str, data_type ); ++ else ++ txt.sprintf( " *DataTypePtr: %d", data_type ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( param_size_ptr ) ++ { ++ if ( param_size == 9999 ) ++ { ++ txt.sprintf( " *ParamSizePtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *ParamSizePtr: %d", param_size ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( decimal_digits_ptr ) ++ { ++ if ( decimal_digits == 9999 ) ++ { ++ txt.sprintf( " *DecimalDigitsPtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *DecimalDigits: %d", decimal_digits ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ if ( nullable_ptr ) ++ { ++ if ( nullable == -9999 ) ++ { ++ txt.sprintf( " *NullablePtr: " ); ++ } ++ else ++ { ++ txt.sprintf( " *NullablePtr: %d", nullable ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dDescribeParam::dDescribeParam( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 240,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 320,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 400,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ param_num = new QLineEdit( this ); ++ param_num->setGeometry( 130, 80, 70, 20 ); ++ param_num->setMaxLength( 6 ); ++ param_num->setText( "1" ); ++ ++ l_param_num = new QLabel( "ParameterNumber:", this ); ++ l_param_num->setGeometry( 10, 80, 120, 20 ); ++ ++ type_valid = new QCheckBox( "DataTypePtr: VALID", this ); ++ type_valid->setGeometry( 10, 110, 250, 15 ); ++ ++ size_valid = new QCheckBox( "ParameterSizePtr: VALID", this ); ++ size_valid->setGeometry( 10, 140, 250, 15 ); ++ ++ digit_valid = new QCheckBox( "DecimalDigits Ptr: VALID", this ); ++ digit_valid->setGeometry( 300, 110, 250, 15 ); ++ ++ null_valid = new QCheckBox( "NullablePtr: VALID", this ); ++ null_valid->setGeometry( 300, 140, 250, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( type_valid, SIGNAL( clicked()), this, SLOT( type_clkd())); ++ connect( size_valid, SIGNAL( clicked()), this, SLOT( size_clkd())); ++ connect( digit_valid, SIGNAL( clicked()), this, SLOT( digit_clkd())); ++ connect( null_valid, SIGNAL( clicked()), this, SLOT( null_clkd())); ++} ++ ++dDescribeParam::~dDescribeParam() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete param_num; ++ delete l_param_num; ++ delete type_valid; ++ delete size_valid; ++ delete digit_valid; ++ delete null_valid; ++} ++ ++void dParamData::value_clkd() ++{ ++ if ( value_valid->isChecked() ) ++ value_valid->setText( "ValuePtr: SQL_NULL_PTR" ); ++ else ++ value_valid->setText( "ValuePtr: VALID" ); ++} ++ ++void dParamData::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLPOINTER *value_ptr, value; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLParamData():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( value_valid->isChecked() ) ++ { ++ value_ptr = NULL; ++ txt.sprintf( " ValuePtr: " ); ++ } ++ else ++ { ++ value_ptr = &value; ++ txt.sprintf( " ValuePtr: %p", value_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLParamData( in_handle, ++ value_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->out_win->append( " Out:" ); ++ ++ if ( SQL_SUCCEEDED( ret )) ++ { ++ if ( value_ptr ) ++ { ++ txt.sprintf( " *ValuePtr: %d", value ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ } ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dParamData::dParamData( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ value_valid = new QCheckBox( "ValuePtr: VALID", this ); ++ value_valid->setGeometry( 10, 80, 250, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( value_valid, SIGNAL( clicked()), this, SLOT( value_clkd())); ++} ++ ++dParamData::~dParamData() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete value_valid; ++} ++ ++void dParamOption::pirow_clkd() ++{ ++ if ( pirow_valid->isChecked() ) ++ pirow_valid->setText( "pirow: SQL_NULL_PTR" ); ++ else ++ pirow_valid->setText( "pirow: VALID" ); ++} ++ ++void dParamOption::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLULEN *pirow_ptr, pirow; ++ SQLUINTEGER crow; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLParamOptions():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ crow = crow_num->text().toInt(); ++ txt.sprintf( " crow: %d", crow ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( pirow_valid->isChecked() ) ++ { ++ pirow_ptr = NULL; ++ txt.sprintf( " pirow: " ); ++ } ++ else ++ { ++ pirow_ptr = &pirow; ++ txt.sprintf( " pirow: %p", pirow_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLParamOptions( in_handle, ++ crow, ++ pirow_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++} ++ ++dParamOption::dParamOption( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 100,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 180,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 260,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ crow_num = new QLineEdit( this ); ++ crow_num->setGeometry( 130, 80, 70, 20 ); ++ crow_num->setMaxLength( 6 ); ++ crow_num->setText( "1" ); ++ ++ l_crow_num = new QLabel( "crow:", this ); ++ l_crow_num->setGeometry( 10, 80, 120, 20 ); ++ ++ pirow_valid = new QCheckBox( "pirow: VALID", this ); ++ pirow_valid->setGeometry( 10, 110, 250, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( pirow_valid, SIGNAL( clicked()), this, SLOT( pirow_clkd())); ++} ++ ++dParamOption::~dParamOption() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete pirow_valid; ++ delete crow_num; ++ delete l_crow_num; ++} ++ ++void dPutData::Ok() ++{ ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_STMT, handles ); ++ SQLHANDLE in_handle = SQL_NULL_HANDLE; ++ SQLPOINTER data_ptr_var; ++ SQLINTEGER strlen_or_len; ++ const char *data_str, *strlen_or_len_str; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ data_str = data_ptr->currentText().toUtf8().constData(); ++ ++ pOdbcTest->out_win->append( "SQLPutData():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ if ( in_handle ) ++ txt.sprintf( " Statement Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Statement Handle: SQL_NULL_HSTMT" ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( strcmp( data_str, "" ) == 0 ) ++ { ++ data_ptr_var = NULL; ++ pOdbcTest->out_win->append( " DataPtr: " ); ++ } ++ else if ( strcmp( data_str, "" ) == 0 ) ++ { ++ data_ptr_var = (SQLPOINTER) ""; ++ pOdbcTest->out_win->append( " DataPtr: " ); ++ } ++ else if ( strcmp( data_str, "" ) == 0 ) ++ { ++ QString *s = new QString( pOdbcTest->in_win->toPlainText() ); ++ if ( s->isEmpty()) ++ data_ptr_var = (SQLPOINTER)""; ++ else if ( s->isNull()) ++ data_ptr_var = NULL; ++ else ++ data_ptr_var = (SQLPOINTER) s->toUtf8().constData(); ++ txt.sprintf( " DataPtr: %s", data_ptr_var ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ else ++ { ++ data_ptr_var = ( SQLPOINTER ) data_str; ++ txt.sprintf( " DataPtr: %s", data_ptr_var ); ++ pOdbcTest->out_win->append( txt ); ++ } ++ ++ strlen_or_len_str = str_len->currentText().toUtf8().constData(); ++ ++ if ( strncmp( strlen_or_len_str, "SQL_NTS", 7 ) == 0 ) ++ { ++ strlen_or_len = SQL_NTS; ++ txt.sprintf( " StrLen_or_ind: SQL_NTS=-3" ); ++ } ++ else if ( strncmp( strlen_or_len_str, "SQL_NULL_DATA", 13 ) == 0 ) ++ { ++ strlen_or_len = SQL_NULL_DATA; ++ txt.sprintf( " StrLen_or_ind: SQL_NULL_DATA=-1" ); ++ } ++ else if ( strncmp( strlen_or_len_str, "SQL_DEFAULT_PARAM", 17 ) == 0 ) ++ { ++ strlen_or_len = SQL_DEFAULT_PARAM; ++ txt.sprintf( " StrLen_or_ind: SQL_DEFAULT_PARAM=-5" ); ++ } ++ else ++ { ++ strlen_or_len = atoi( strlen_or_len_str ); ++ txt.sprintf( " StrLen_or_ind: %d", strlen_or_len ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLPutData( in_handle, data_ptr_var, strlen_or_len ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dPutData::dPutData( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 150,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 230,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 310,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ data_ptr = new QComboBox( this ); ++ data_ptr->setEditable( true ); ++ data_ptr->setGeometry( 130, 80, 250, 20 ); ++ data_ptr->insertItem( 0, "" ); ++ data_ptr->insertItem( 1, "" ); ++ data_ptr->insertItem( 2, "" ); ++ ++ str_len = new QComboBox( this ); ++ str_len->setEditable( true ); ++ str_len->setGeometry( 130, 110, 200, 20 ); ++ ++ str_len->insertItem( 0, "SQL_NTS=-3" ); ++ str_len->insertItem( 1, "SQL_NULL_DATA=-1" ); ++ str_len->insertItem( 2, "SQL_DEFAULT_PARAM=-5" ); ++ str_len->insertItem( 3, "0" ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ l_data_ptr = new QLabel( "DataPtr:", this ); ++ l_data_ptr->setGeometry( 10, 80, 70, 20 ); ++ ++ l_str_len = new QLabel( "StrLen_or_IndPtr:", this ); ++ l_str_len->setGeometry( 10, 110, 70, 20 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dPutData::~dPutData() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete data_ptr; ++ delete l_handle; ++ delete l_data_ptr; ++ delete str_len; ++ delete l_str_len; ++} ++ ++void dBindParameter::Ok() ++{ ++} ++ ++dBindParameter::dBindParameter( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 450,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 530,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 610,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ param_num = new QLineEdit( this ); ++ param_num->setGeometry( 130, 80, 70, 20 ); ++ param_num->setMaxLength( 6 ); ++ param_num->setText( "1" ); ++ ++ l_param_num = new QLabel( "ParameterNumber:", this ); ++ l_param_num->setGeometry( 10, 80, 120, 20 ); ++ ++ io_type = new QComboBox( this ); ++ io_type->setGeometry( 420, 80, 250, 20 ); ++ ++ pOdbcTest->fill_list_box( io_type_option, io_type ); ++ ++ l_io_type = new QLabel( "InputOutputType:", this ); ++ l_io_type->setGeometry( 320, 80, 100, 20 ); ++ ++ value_type = new QComboBox( this ); ++ value_type->setGeometry( 130, 110, 360, 20 ); ++ ++ pOdbcTest->fill_list_box( value_type_option, value_type ); ++ ++ l_value_type = new QLabel( "ValueType:", this ); ++ l_value_type->setGeometry( 10, 110, 100, 20 ); ++ ++ column_size = new QLineEdit( this ); ++ column_size->setGeometry( 600, 110, 70, 20 ); ++ column_size->setMaxLength( 6 ); ++ column_size->setText( "0" ); ++ ++ l_column_size = new QLabel( "ColumnSize:", this ); ++ l_column_size->setGeometry( 500, 110, 100, 20 ); ++ ++ param_type = new QComboBox( this ); ++ param_type->setGeometry( 130, 140, 360, 20 ); ++ ++ pOdbcTest->fill_list_box( param_type_option, param_type ); ++ ++ l_param_type = new QLabel( "ParameterType:", this ); ++ l_param_type->setGeometry( 10, 140, 100, 20 ); ++ ++ decimal_digits = new QLineEdit( this ); ++ decimal_digits->setGeometry( 600, 140, 70, 20 ); ++ decimal_digits->setMaxLength( 6 ); ++ decimal_digits->setText( "0" ); ++ ++ l_decimal_digits = new QLabel( "DecimalDigits:", this ); ++ l_decimal_digits->setGeometry( 500, 140, 100, 20 ); ++ ++ param_value = new QComboBox( this ); ++ param_value->setGeometry( 130, 170, 360, 20 ); ++ ++ param_value->insertItem( 0, "" ); ++ param_value->insertItem( 1, "" ); ++ ++ l_param_value = new QLabel( "ParameterValuePtr:", this ); ++ l_param_value->setGeometry( 10, 170, 120, 20 ); ++ ++ buffer_length = new QLineEdit( this ); ++ buffer_length->setGeometry( 600, 170, 70, 20 ); ++ buffer_length->setMaxLength( 6 ); ++ buffer_length->setText( "0" ); ++ ++ l_buffer_length = new QLabel( "BufferLength:", this ); ++ l_buffer_length->setGeometry( 500, 170, 100, 20 ); ++ ++ strlen_or_ind = new QComboBox( this ); ++ strlen_or_ind->setEditable( true ); ++ strlen_or_ind->setGeometry( 130, 200, 360, 20 ); ++ ++ strlen_or_ind->insertItem( 0, "SQL_NTS=-3" ); ++ strlen_or_ind->insertItem( 1, "SQL_NULL_DATA=-1" ); ++ strlen_or_ind->insertItem( 2, "SQL_DATA_AT_EXEC=-2" ); ++ strlen_or_ind->insertItem( 3, "SQL_DEFAULT_PARAM=-5" ); ++ strlen_or_ind->insertItem( 4, "" ); ++ strlen_or_ind->insertItem( 5, "0" ); ++ ++ l_strlen_or_ind = new QLabel( "StrLen_or_IndPtr:", this ); ++ l_strlen_or_ind->setGeometry( 10, 200, 100, 20 ); ++ ++ len_data_at_exec = new QCheckBox( "SQL_LEN_DATA_AT_EXEC", this ); ++ len_data_at_exec->setGeometry( 500, 200, 190, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dBindParameter::~dBindParameter() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete io_type; ++ delete l_io_type; ++ delete param_num; ++ delete l_param_num; ++ delete value_type; ++ delete l_value_type; ++ delete column_size; ++ delete l_column_size; ++ delete param_type; ++ delete l_param_type; ++ delete decimal_digits; ++ delete l_decimal_digits; ++ delete param_value; ++ delete l_param_value; ++ delete buffer_length; ++ delete l_buffer_length; ++ delete strlen_or_ind; ++ delete l_strlen_or_ind; ++ delete len_data_at_exec; ++} ++ ++void dBindParam::Ok() ++{ ++} ++ ++dBindParam::dBindParam( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 450,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 530,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 610,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 130, 50, 200, 20 ); ++ pOdbcTest->fill_handle_list( SQL_HANDLE_STMT, handles ); ++ ++ l_handle = new QLabel( "Statement Handle:", this ); ++ l_handle->setGeometry( 10, 50, 120, 20 ); ++ ++ param_num = new QLineEdit( this ); ++ param_num->setGeometry( 130, 80, 70, 20 ); ++ param_num->setMaxLength( 6 ); ++ param_num->setText( "1" ); ++ ++ l_param_num = new QLabel( "ParameterNumber:", this ); ++ l_param_num->setGeometry( 10, 80, 120, 20 ); ++ ++ value_type = new QComboBox( this ); ++ value_type->setGeometry( 130, 110, 360, 20 ); ++ ++ pOdbcTest->fill_list_box( value_type_option, value_type ); ++ ++ l_value_type = new QLabel( "ValueType:", this ); ++ l_value_type->setGeometry( 10, 110, 100, 20 ); ++ ++ column_size = new QLineEdit( this ); ++ column_size->setGeometry( 600, 110, 70, 20 ); ++ column_size->setMaxLength( 6 ); ++ column_size->setText( "0" ); ++ ++ l_column_size = new QLabel( "ColumnSize:", this ); ++ l_column_size->setGeometry( 500, 110, 100, 20 ); ++ ++ param_type = new QComboBox( this ); ++ param_type->setGeometry( 130, 140, 360, 20 ); ++ ++ pOdbcTest->fill_list_box( param_type_option, param_type ); ++ ++ l_param_type = new QLabel( "ParameterType:", this ); ++ l_param_type->setGeometry( 10, 140, 100, 20 ); ++ ++ decimal_digits = new QLineEdit( this ); ++ decimal_digits->setGeometry( 600, 140, 70, 20 ); ++ decimal_digits->setMaxLength( 6 ); ++ decimal_digits->setText( "0" ); ++ ++ l_decimal_digits = new QLabel( "DecimalDigits:", this ); ++ l_decimal_digits->setGeometry( 500, 140, 100, 20 ); ++ ++ param_value = new QComboBox( this ); ++ param_value->setGeometry( 130, 170, 360, 20 ); ++ ++ param_value->insertItem( 0, "" ); ++ param_value->insertItem( 1, "" ); ++ ++ l_param_value = new QLabel( "ParameterValuePtr:", this ); ++ l_param_value->setGeometry( 10, 170, 120, 20 ); ++ ++ strlen_or_ind = new QComboBox( this ); ++ strlen_or_ind->setEditable( true ); ++ strlen_or_ind->setGeometry( 130, 200, 360, 20 ); ++ ++ strlen_or_ind->insertItem( 0, "SQL_NTS=-3" ); ++ strlen_or_ind->insertItem( 1, "SQL_NULL_DATA=-1" ); ++ strlen_or_ind->insertItem( 2, "SQL_DATA_AT_EXEC=-2" ); ++ strlen_or_ind->insertItem( 3, "SQL_DEFAULT_PARAM=-5" ); ++ strlen_or_ind->insertItem( 4, "" ); ++ strlen_or_ind->insertItem( 5, "0" ); ++ ++ l_strlen_or_ind = new QLabel( "StrLen_or_IndPtr:", this ); ++ l_strlen_or_ind->setGeometry( 10, 200, 100, 20 ); ++ ++ len_data_at_exec = new QCheckBox( "SQL_LEN_DATA_AT_EXEC", this ); ++ len_data_at_exec->setGeometry( 500, 200, 190, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++} ++ ++dBindParam::~dBindParam() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handles; ++ delete l_handle; ++ delete param_num; ++ delete l_param_num; ++ delete value_type; ++ delete l_value_type; ++ delete column_size; ++ delete l_column_size; ++ delete param_type; ++ delete l_param_type; ++ delete decimal_digits; ++ delete l_decimal_digits; ++ delete param_value; ++ delete l_param_value; ++ delete strlen_or_ind; ++ delete l_strlen_or_ind; ++ delete len_data_at_exec; ++} ++ ++void dAllocStmt::handle_clkd() ++{ ++ if ( handle_valid->isChecked() ) ++ handle_valid->setText( "phstmt: SQL_NULL_POINTER" ); ++ else ++ handle_valid->setText( "phstmt: VALID" ); ++} ++ ++void dAllocStmt::Ok() ++{ ++ SQLHSTMT hstmt, *hstmt_ptr; ++ OdbcHandle *hand = pOdbcTest->extract_handle_list( SQL_HANDLE_DBC, handles ); ++ SQLHANDLE in_handle = NULL; ++ ++ if ( hand ) ++ in_handle = hand->getHandle(); ++ ++ pOdbcTest->out_win->append( "SQLAllocStmt():" ); ++ pOdbcTest->out_win->append( " In:" ); ++ ++ if ( in_handle ) ++ txt.sprintf( " Connection Handle: %p", in_handle ); ++ else ++ txt.sprintf( " Connection Handle: SQL_NULL_HDBC" ); ++ ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( handle_valid->isChecked()) ++ { ++ hstmt_ptr = NULL; ++ txt.sprintf( " phstmt: SQL_NULL_HANDLE" ); ++ } ++ else ++ { ++ hstmt_ptr = &hstmt; ++ txt.sprintf( " phstmt: %p", hstmt_ptr ); ++ } ++ pOdbcTest->out_win->append( txt ); ++ ++ SQLRETURN ret = SQLAllocStmt( in_handle, hstmt_ptr ); ++ ++ pOdbcTest->out_win->append( " Return:" ); ++ txt.sprintf( " %s=%d", pOdbcTest->return_as_text( ret ), ret ); ++ pOdbcTest->out_win->append( txt ); ++ ++ if ( SQL_SUCCEEDED( ret ) && hstmt_ptr ) ++ { ++ txt.sprintf( " *phstmt: %p", hstmt ); ++ pOdbcTest->out_win->append( txt ); ++ ++ pOdbcTest->listHandle.append( new OdbcHandle( SQL_HANDLE_STMT, hstmt, pOdbcTest->listHandle )); ++ } ++ ++ pOdbcTest->out_win->append( "" ); ++} ++ ++dAllocStmt::dAllocStmt( OdbcTest *pOdbcTest, QString name ) ++ : QDialog( pOdbcTest ) ++{ ++ setWindowTitle( name ); ++ setModal( true ); ++ this->pOdbcTest = pOdbcTest; ++ ++ ok = new QPushButton( "OK", this ); ++ ok->setGeometry( 90,10, 70,25 ); ++ ++ cancel = new QPushButton( "Cancel", this ); ++ cancel->setGeometry( 170,10, 70,25 ); ++ ++ help = new QPushButton( "Help", this ); ++ help->setGeometry( 250,10, 70,25 ); ++ ++ handles = new QComboBox( this ); ++ handles->setGeometry( 100, 50, 200, 20 ); ++ ++ pOdbcTest->fill_handle_list( SQL_HANDLE_DBC, handles ); ++ ++ l_handles = new QLabel( "Handle:", this ); ++ l_handles->setGeometry( 10, 50, 80, 20 ); ++ ++ handle_valid = new QCheckBox( "phstmt: VALID", this ); ++ handle_valid->setGeometry( 10, 80, 300, 15 ); ++ ++ connect( cancel, SIGNAL(clicked()), SLOT(reject()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(Ok()) ); ++ connect( ok, SIGNAL(clicked()), SLOT(accept()) ); ++ connect( handle_valid, SIGNAL( clicked()), this, SLOT( handle_clkd())); ++} ++ ++dAllocStmt::~dAllocStmt() ++{ ++ delete ok; ++ delete cancel; ++ delete help; ++ delete handle_valid; ++ delete handles; ++ delete l_handles; ++} ++ ++void OdbcTest::slotBindParameter() ++{ ++ dBindParameter *dlg = new dBindParameter( this, "SQLBindParameter" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotCancel() ++{ ++ dCancel *dlg = new dCancel( this, "SQLCancel" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotCloseCursor() ++{ ++ dCloseCursor *dlg = new dCloseCursor( this, "SQLCloseCursor" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotDescribeParam() ++{ ++ dDescribeParam *dlg = new dDescribeParam( this, "SQLDescribeParam" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotExecute() ++{ ++ dExecute *dlg = new dExecute( this, "SQLExecute" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotExecDirect() ++{ ++ dExecDirect *dlg = new dExecDirect( this, "SQLExecDirect" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFreeStmt() ++{ ++ dFreeStmt *dlg = new dFreeStmt( this, "SQLFreeStmt" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotGetCursorName() ++{ ++ dGetCursorName *dlg = new dGetCursorName( this, "SQLGetCursorName" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotNumParams() ++{ ++ dNumParams *dlg = new dNumParams( this, "SQLNumParams" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotParamData() ++{ ++ dParamData *dlg = new dParamData( this, "SQLParamData" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotParamOptions() ++{ ++ dParamOption *dlg = new dParamOption( this, "SQLParamOptions" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotPrepare() ++{ ++ dPrepare *dlg = new dPrepare( this, "SQLPrepare" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotPutData() ++{ ++ dPutData *dlg = new dPutData( this, "SQLPutData" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotSetCursorName() ++{ ++ dSetCursorName *dlg = new dSetCursorName( this, "SQLSetCursorName" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotAllocStmt() ++{ ++ dAllocStmt *dlg = new dAllocStmt( this, "SQLAllocStmt" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotBindParam() ++{ ++ dBindParam *dlg = new dBindParam( this, "SQLBindParam" ); ++ ++ dlg->exec(); ++ ++ delete dlg; ++} ++ ++void OdbcTest::slotFillParam() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotShowParam() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} ++ ++void OdbcTest::slotShowCursorSettings() ++{ ++ QMessageBox::about( this, "ODBC Test", ++ "Not yet implemented" ); ++} +diff --git a/unixODBC-2.3.7/tests/stmt.h b/unixODBC-2.3.7/tests/stmt.h +new file mode 100644 +index 0000000..ca41ce0 +--- /dev/null ++++ b/unixODBC-2.3.7/tests/stmt.h +@@ -0,0 +1,405 @@ ++/********************************************************************* ++ * ++ * Written by Nick Gorham ++ * (nick@lurcher.org). ++ * ++ * copyright (c) 1999 Nick Gorham ++ * ++ * 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. ++ * ++ * 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. ++ * ++ ********************************************************************** ++ * ++ * 2008-12-10 Code adopted by unixODBC-GUI-Qt project. Heavily altered ++ * pharvey to be Qt4 only code. ++ * ++ **********************************************************************/ ++ ++#pragma once ++ ++#include "OdbcHandle.h" ++ ++class OdbcTest; ++ ++class dPrepare : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dPrepare( OdbcTest *pOdbcTest, QString name ); ++ ~dPrepare(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *str, *name_len; ++ QLabel *l_handle, *l_str, *l_name_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dExecute : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dExecute( OdbcTest *pOdbcTest, QString name ); ++ ~dExecute(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dExecDirect : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dExecDirect( OdbcTest *pOdbcTest, QString name ); ++ ~dExecDirect(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *str, *name_len; ++ QLabel *l_handle, *l_str, *l_name_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dNumParams : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dNumParams( OdbcTest *pOdbcTest, QString name ); ++ ~dNumParams(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QCheckBox *valid; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Valid(); ++ void Ok(); ++}; ++ ++class dCancel : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dCancel( OdbcTest *pOdbcTest, QString name ); ++ ~dCancel(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dCloseCursor : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dCloseCursor( OdbcTest *pOdbcTest, QString name ); ++ ~dCloseCursor(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dGetCursorName : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dGetCursorName( OdbcTest *pOdbcTest, QString name ); ++ ~dGetCursorName(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *option; ++ QLabel *l_handle, *l_option, *l_buffer_len; ++ QCheckBox *name_valid, *cursor_valid; ++ QLineEdit *buffer_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void CursorValid(); ++ void NameValid(); ++}; ++ ++class dFreeStmt : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dFreeStmt( OdbcTest *pOdbcTest, QString name ); ++ ~dFreeStmt(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *option; ++ QLabel *l_handle, *l_option; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dSetCursorName : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dSetCursorName( OdbcTest *pOdbcTest, QString name ); ++ ~dSetCursorName(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *str, *name_len; ++ QLabel *l_handle, *l_str, *l_name_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dDescribeParam : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dDescribeParam( OdbcTest *pOdbcTest, QString name ); ++ ~dDescribeParam(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLineEdit *param_num; ++ QLabel *l_handle, *l_param_num; ++ QCheckBox *type_valid; ++ QCheckBox *digit_valid; ++ QCheckBox *size_valid; ++ QCheckBox *null_valid; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ const char *data_type_to_str( int ); ++ ++ protected slots: ++ void type_clkd(); ++ void digit_clkd(); ++ void size_clkd(); ++ void null_clkd(); ++ void Ok(); ++}; ++ ++class dParamData : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dParamData( OdbcTest *pOdbcTest, QString name ); ++ ~dParamData(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QCheckBox *value_valid; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void value_clkd(); ++ void Ok(); ++}; ++ ++class dParamOption : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dParamOption( OdbcTest *pOdbcTest, QString name ); ++ ~dParamOption(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles; ++ QLabel *l_handle; ++ QLineEdit *crow_num; ++ QLabel *l_param_num, *l_crow_num; ++ QCheckBox *pirow_valid; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void pirow_clkd(); ++ void Ok(); ++}; ++ ++class dPutData : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dPutData( OdbcTest *pOdbcTest, QString name ); ++ ~dPutData(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *data_ptr, *str_len; ++ QLabel *l_handle, *l_data_ptr, *l_str_len; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dBindParameter : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dBindParameter( OdbcTest *pOdbcTest, QString name ); ++ ~dBindParameter(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *io_type, *value_type; ++ QComboBox *param_type, *param_value, *strlen_or_ind; ++ QLabel *l_handle, *l_io_type, *l_value_type; ++ QLabel *l_param_type, *l_param_value, *l_strlen_or_ind, *l_param_num; ++ QLineEdit *column_size, *decimal_digits, *buffer_length, *param_num; ++ QLabel *l_column_size, *l_decimal_digits, *l_buffer_length; ++ QCheckBox *len_data_at_exec; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dBindParam : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dBindParam( OdbcTest *pOdbcTest, QString name ); ++ ~dBindParam(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QComboBox *handles, *value_type; ++ QComboBox *param_type, *param_value, *strlen_or_ind; ++ QLabel *l_handle, *l_value_type; ++ QLabel *l_param_type, *l_param_value, *l_strlen_or_ind, *l_param_num; ++ QLineEdit *column_size, *decimal_digits, *param_num; ++ QLabel *l_column_size, *l_decimal_digits; ++ QCheckBox *len_data_at_exec; ++ QTextEdit *in_win; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++}; ++ ++class dAllocStmt : public QDialog ++{ ++ Q_OBJECT ++ ++ public: ++ dAllocStmt( OdbcTest *pOdbcTest, QString name ); ++ ~dAllocStmt(); ++ ++ protected: ++ QPushButton *ok, *cancel, *help; ++ QTextEdit *in_win; ++ QCheckBox *handle_valid; ++ QComboBox *handles; ++ QLabel *l_handles; ++ QTextEdit *out_win; ++ OdbcTest *pOdbcTest; ++ QString txt; ++ ++ protected slots: ++ void Ok(); ++ void handle_clkd(); ++}; ++ ++