Click here to Skip to main content
12,447,242 members (52,120 online)
Click here to Skip to main content
Articles » Database » Database » ODBC » Downloads

Stats

169K views
3.8K downloads
55 bookmarked
Posted

CODBCAccess: a CDatabase and CRecordset Wrapper

, 12 Mar 2003
A class to wrap the use of CDatabase and CRecordset into one object to communicate with databases
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""res\\ODBCExample.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\ODBCExample.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ODBCExample"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
    LTEXT           "ODBCExample Version 1.0",IDC_STATIC,40,10,119,8,
                    SS_NOPREFIX
    LTEXT           "Copyright (C) 2001",IDC_STATIC,40,25,119,8
    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
END

IDD_ODBCEXAMPLE_DIALOG DIALOGEX 0, 0, 252, 97
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "ODBCExample"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
    GROUPBOX        "Configure or Connect to a Data Source",IDC_STATIC,7,7,
                    238,55
    PUSHBUTTON      "Configure a Data Source",IDC_DATASOURCE,17,24,105,28
    DEFPUSHBUTTON   "Close",IDOK,7,68,238,22
    PUSHBUTTON      "Connect to a Data Source",IDC_CONNECT,130,24,105,28
END

IDD_MAIN DIALOG DISCARDABLE  0, 0, 285, 182
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ODBCAccess Operations"
FONT 8, "MS Sans Serif"
BEGIN
    GROUPBOX        "SQL Support",IDC_STATIC,7,7,271,106
    PUSHBUTTON      "Start Transaction",IDC_BEGINTRANS,17,21,77,19
    EDITTEXT        IDC_SQL,17,48,246,38,ES_MULTILINE | ES_AUTOVSCROLL | 
                    WS_VSCROLL
    PUSHBUTTON      "Send SQL",IDC_SENDSQL,184,91,79,18
    PUSHBUTTON      "Rollback Changes",IDC_ROLLBACK,101,21,77,19,WS_DISABLED
    PUSHBUTTON      "End Transaction",IDC_ENDTRANS,185,21,77,19,WS_DISABLED
    GROUPBOX        "Other Operations",IDC_STATIC,7,115,271,40
    PUSHBUTTON      "Recordset Operations",IDC_RECORDSET,14,128,126,20
    PUSHBUTTON      "Disconnect",IDOK,143,128,126,20
    LTEXT           "Sets currently open:",IDC_SETOPEN,7,161,271,14
END

IDD_CONFIG DIALOG DISCARDABLE  0, 0, 279, 221
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Configure a Data Source"
FONT 8, "MS Sans Serif"
BEGIN
    COMBOBOX        IDC_DRIVER,15,21,111,155,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
    EDITTEXT        IDC_NAME,134,19,129,16,ES_AUTOHSCROLL
    COMBOBOX        IDC_OPTION,15,60,248,155,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
    EDITTEXT        IDC_SOURCENAME,77,97,188,16,ES_AUTOHSCROLL
    EDITTEXT        IDC_DATABASENAME,77,119,170,16,ES_AUTOHSCROLL
    PUSHBUTTON      "...",IDC_BROWSE,247,119,18,16
    EDITTEXT        IDC_CONNECT,14,161,251,15,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "Configure!",IDOK,7,189,132,25
    PUSHBUTTON      "Cancel",IDCANCEL,140,189,132,25
    GROUPBOX        "Source Option:",IDC_STATIC,7,46,265,35
    GROUPBOX        "Access Driver Options:",IDC_STATIC,7,84,265,62
    GROUPBOX        "Driver Type:",IDC_STATIC,7,7,265,35
    LTEXT           "Datasource Name:\n(DSN)",IDC_STATIC,13,97,62,18
    LTEXT           "Default Database:\n(DBQ)",IDC_STATIC,13,122,62,19
    GROUPBOX        "Other Driver Connection String:",IDC_STATIC,7,148,265,
                    36
END

IDD_RECORDSET DIALOG DISCARDABLE  0, 0, 285, 201
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Recordset Operations"
FONT 8, "MS Sans Serif"
BEGIN
    GROUPBOX        "Open Sets:",IDC_STATIC,7,7,156,158
    CONTROL         "List1",IDC_SETS,"SysListView32",LVS_REPORT | WS_BORDER | 
                    WS_TABSTOP,16,21,136,135
    PUSHBUTTON      "Open New Set",IDC_OPENNEW,167,7,111,21
    PUSHBUTTON      "Close Set",IDC_CLOSE,167,29,111,21
    PUSHBUTTON      "View Set Results",IDC_VIEW,167,144,111,21
    LTEXT           "In addition to the commands here, you can call CODBCAccess::GetSet() to obtain the pointer to a set and perform any operations on it.\n\nCODBCAccess manages each set, so you never have to call 'new' or 'delete.'",
                    IDC_STATIC,169,59,109,80
    PUSHBUTTON      "Close",IDOK,7,168,271,26
END

IDD_NAMEPROMPT DIALOG DISCARDABLE  0, 0, 278, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "New Set Options"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,221,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,221,23,50,14
    EDITTEXT        IDC_NAME,13,19,198,16,ES_AUTOHSCROLL
    GROUPBOX        "'Friendly Name' for the set:",IDC_STATIC,7,7,211,38
    EDITTEXT        IDC_SQL,15,60,247,36,ES_MULTILINE | ES_AUTOVSCROLL | 
                    WS_VSCROLL
    GROUPBOX        "",IDC_STATIC,7,47,264,60
    GROUPBOX        "",IDC_STATIC,7,110,264,38
    COMBOBOX        IDC_TABLE,15,125,247,90,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
    CONTROL         "SQL Query to execute for the set:",IDC_USESQL,"Button",
                    BS_AUTORADIOBUTTON | WS_GROUP,15,47,119,8
    CONTROL         "OR, Table name to execute for the set",IDC_USETABLE,
                    "Button",BS_AUTORADIOBUTTON,15,111,135,8
END

IDD_VIEWSET DIALOG DISCARDABLE  0, 0, 296, 210
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "View Set Results"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "List1",IDC_SET,"SysListView32",LVS_REPORT | WS_BORDER | 
                    WS_TABSTOP,7,7,282,173
    DEFPUSHBUTTON   "Done",IDOK,7,183,282,20
END


#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "CompanyName", "\0"
            VALUE "FileDescription", "ODBCExample MFC Application\0"
            VALUE "FileVersion", "1, 0, 0, 1\0"
            VALUE "InternalName", "ODBCExample\0"
            VALUE "LegalCopyright", "Copyright (C) 2001\0"
            VALUE "LegalTrademarks", "\0"
            VALUE "OriginalFilename", "ODBCExample.EXE\0"
            VALUE "ProductName", "ODBCExample Application\0"
            VALUE "ProductVersion", "1, 0, 0, 1\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

#endif    // !_MAC


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 228
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END

    IDD_ODBCEXAMPLE_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 245
        TOPMARGIN, 7
        BOTTOMMARGIN, 90
    END

    IDD_MAIN, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 278
        TOPMARGIN, 7
        BOTTOMMARGIN, 175
    END

    IDD_CONFIG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 272
        TOPMARGIN, 7
        BOTTOMMARGIN, 214
    END

    IDD_RECORDSET, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 278
        TOPMARGIN, 7
        BOTTOMMARGIN, 194
    END

    IDD_NAMEPROMPT, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 271
        TOPMARGIN, 7
        BOTTOMMARGIN, 147
    END

    IDD_VIEWSET, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 289
        TOPMARGIN, 7
        BOTTOMMARGIN, 203
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//

IDD_CONFIG DLGINIT
BEGIN
    IDC_DRIVER, 0x403, 22, 0
0x6341, 0x6563, 0x7373, 0x4420, 0x6972, 0x6576, 0x2072, 0x2a28, 0x6d2e, 
0x6264, 0x0029, 
    IDC_DRIVER, 0x403, 26, 0
0x744f, 0x6568, 0x2072, 0x7244, 0x7669, 0x7265, 0x202c, 0x7073, 0x6365, 
0x6669, 0x2079, 0x2d2d, 0x003e, 
    IDC_OPTION, 0x403, 34, 0
0x4144, 0x4154, 0x4f53, 0x5255, 0x4543, 0x415f, 0x4444, 0x203a, 0x6441, 
0x2064, 0x2061, 0x6164, 0x6174, 0x7320, 0x756f, 0x6372, 0x0065, 
    IDC_OPTION, 0x403, 37, 0
0x4144, 0x4154, 0x4f53, 0x5255, 0x4543, 0x4d5f, 0x444f, 0x203a, 0x6f4d, 
0x6964, 0x7966, 0x6120, 0x6420, 0x7461, 0x2061, 0x6f73, 0x7275, 0x6563, 
"\000" 
    IDC_OPTION, 0x403, 37, 0
0x4144, 0x4154, 0x4f53, 0x5255, 0x4543, 0x445f, 0x4c45, 0x203a, 0x6544, 
0x656c, 0x6574, 0x6120, 0x6420, 0x7461, 0x2061, 0x6f73, 0x7275, 0x6563, 
"\000" 
    0
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_ABOUTBOX            "&About ODBCExample..."
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\ODBCExample.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Alexander Wiseman
United States United States
I work with C++, C#, Perl, PHP, HTML (with a lot of CSS), and a little bit of ASP.NET. I have been programming for 7 years.

I also enjoy translating Latin, and especially reading authors whose primary language was Latin, including Virgil (or Vergil for the Latinate spelling), Julius Caesar, Catullus, Cicero, and some others (like Martial). I enjoy classical music, most especially Mozart and Bach.

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 13 Mar 2003
Article Copyright 2001 by Alexander Wiseman
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid