SOL9 2.0 Sample: AccessADOXProceduresApplet

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * AccessADOXProceduresApplet.cpp 
 * Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2009/06/03
// Assumes that environment of SQL Server 2008 and SQLClient1.0 or Access2007

#include <sol/sql/ADOXApplet.h>

namespace SOL {

class AccessADOXProceduresApplet: public ADOXApplet {

public:
    /**
     * Constructor
     */
    AccessADOXProceduresApplet(int argc, const TCHAR** argv)
        :ADOXApplet(argc, argv)
    {
    }

public:
    ~AccessADOXProceduresApplet()
    {
    }

public:
    /**
     * AccessADOXProceduresApplett main procedure
     */
    virtual void run()
    {
        String encoding = "";
        getXMLEncoding(encoding);

        printf("<?xml version=\"1.0\" encoding=\"%s\" ?>\n", (const TCHAR*)encoding);
        printf("<!--\n");

        printf("1 Start\n");

        try {

            ADOXCatalog& catalog = getCatalog();
            printf("2 OK, getCatalog()\n");

            printf("3 Show important connectionProperties\n");
            showConnectionProperties();
            printf("\n");

            printf("4 Try to catalog.getTables()\n");
            ADOXTables tables;
            catalog.getTables(tables);
            printf("5 OK catalog.getTables()\n");
    

            printf("6 Try to catalog.getProcedures()\n");

            ADOXProcedures  procs;
            catalog.getProcedures(procs);
            printf("7 OK catalog.getProcedures()\n");

            long c = procs.getCount();
            printf("Procedures Count=%ld\n", c);
            printf("-->\n");

            procs.dump();

        } catch (Exception& ex) {
            ex.dump();
        } catch (_com_error& ex) {
            COMError error(ex);
            error.dump();
        } catch (...) {
            printf("Exception: Unknown\n");
        }
    }
};

}

// Console application starts here.
void _tmain(int argc, const TCHAR** argv)
{
    try {
        AccessADOXProceduresApplet applet(argc, argv);

        applet.start();

    } catch(Exception& ex){
        ex.dump();
    } catch(...){
        printf("Exception:Unknown\n");
    }
}


Last modified: 11 Nov 2009

Copyright (c) 2009 Antillia.com ALL RIGHTS RESERVED.