podbc.h File Reference

#include <ptlib.h>

Go to the source code of this file.

Defines

#define PODBC_H


Define Documentation

#define PODBC_H

ODBC Support for PWLIB

Class Description PODBC : Main DataBase Connection Class (Derive Class for Error Handling) PODBC::ConnectData : Class used to store information for Connecting to DataSource PODBC::Table : Retrieved Data Structure (RecordSet) from Table or Select SQL Query PODBC::Row : Record Pointer Class for the PODBC::Table (PArray of Fields) PODBC::Field : Database Field Information (Field Structure & Data(Bound)) PODBC::Field:Bind : DataTypes Bound to the RecordSet (change with Record Navigation) PDSNConnection : Derived Class of PODBC for ODBC Configured Connections PODBCStmt : Wrapper for RecordSet (Internal) PODBCRecord : Handle Retrieve/Post/Bind Data from RecordSet (Internal)

{verbatim} Example of Use

PODBC link; PODBC::ConnectData data; data.DBPath = "test.mdb";

if (link.DataSource(PODBC::MSAccess,data)) { Load a Database Table (could also be a SELECT Query) PODBC::Table table(&link,"FooTable"); Bind to Column 1 PODBC::Field & field = table.Column(1): Display Contents cout << " Value " << field.AsString(); << endl; Move to Record 2 of fooTable table[2]; Display contents of Record 2 Column 1 cout << " Value " << field.AsString(); << endl; Set New Value for Record 2 Field 1 of FooTable field.SetValue("NewValue"); Send Update to Database. field.Post();

To Add New Record.(with Default Values) table.NewRow(); Alter the Value of field 1 field.SetValue("Somethng"); Post the New Field to the Database field.Post();

Run General Query; PString SQLStmt = "INSERT foo into [FooTable] ..." Link.Query(SQLStmt); } Disconnect from ODBC Source link.Disconnect();

{verbatim}


Generated on Mon Feb 23 01:57:55 2009 for PTLib by  doxygen 1.5.1