95 #endif // _MSC_VER > 1000 98 #if defined(P_ODBC) && !defined(_WIN32_WCE) 100 #include <odbcinst.h> 106 #pragma comment(lib,"odbc32.lib") 107 #pragma comment(lib,"odbcCP32.lib") 125 #define MAX_DATA_LEN 1024 437 void SetDefaultValues();
442 PBoolean DataFragment(
PString & Buffer ,PINDEX & fragment, SQLINTEGER & size);
490 Field & Column(PINDEX col);
510 Field & operator[] (PINDEX col);
603 Row & RecordHandler();
607 Row & operator[] (PINDEX row);
613 Field & operator() (PINDEX row, PINDEX col);
618 Field & Column(PINDEX col);
713 int Port=3306,
int Option=0);
719 int Port=3306,
int Option=0);
755 void SetPrecision(
int Digit);
763 operator HDBC() {
return m_hDBC; };
840 SQLINTEGER * dataLen=NULL,
841 int Type=SQL_C_DEFAULT
847 PString GetLongData(PINDEX Column);
869 USHORT Column,LPVOID pBuffer,
871 LONG * pReturnedBufferSize=NULL,
872 USHORT nType=SQL_C_TCHAR
881 PINDEX ColumnByName(
PString Column);
885 PINDEX ColumnCount();
893 DWORD ColumnSize( PINDEX Column );
897 DWORD ColumnScale( PINDEX Column );
901 PString ColumnName( PINDEX Column);
907 unsigned int ColumnPrecision( PINDEX Column );
911 PBoolean IsColumnNullable( PINDEX Column );
915 PBoolean IsColumnUpdatable( PINDEX Column );
919 PBoolean IsColumnAutoIndex( PINDEX Column );
943 #endif // PTLIB_PODBC_H
CHAR TCHAR
ODBC Support for PWLIB.
Definition: podbc.h:116
HSTMT m_hStmt
Definition: podbc.h:242
PwType Type
Data Field to ODBC Bind to.
Definition: podbc.h:448
virtual void OnSQLError(PString RetCode, PString RetString)
OnSQL Error.
Definition: podbc.h:746
PInt64 sbint
Unsigned char SQLCHAR *.
Definition: podbc.h:410
SQLLEN dataLen
GUID Structure (not Fully Supported)
Definition: podbc.h:415
PODBCStmt stmt
Definition: podbc.h:626
PODBC::DataSources dbase
Statement Class.
Definition: podbc.h:935
PBoolean isNullable
Is Field Readonly.
Definition: podbc.h:457
Row * RowHandler
Name of the Fetched Table (if used in Constructor)
Definition: podbc.h:628
PString tableName
ODBC Fetched Statement Info.
Definition: podbc.h:627
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PBoolean FetchFirst()
FetchFirst Fetch the First row in the RecordSet.
PArray< Field > Fields
Number of Rows.
Definition: podbc.h:544
DWORD GetChangedRowCount(void)
GetChangedRowCount retreives the number of rows updated/altered by UPDATE/INSERT statements.
PwType
Converted Pwlib Field Types.
Definition: podbc.h:314
HSTMT m_hStmt
Time Format.
Definition: podbc.h:933
PString sbinlong
Strings & Binary Data.
Definition: podbc.h:404
PODBC Class The Main ODBC class.
Definition: podbc.h:259
PBoolean IsValid()
IsValid Checks to ensure a Handle has been allocated and is effective.
HDBC m_hDBC
Definition: podbc.h:771
PBoolean Excl_Trust
Password.
Definition: podbc.h:377
int dbase
Reference to the PODBC Class.
Definition: podbc.h:244
This class is a multipurpose use class for storing parameters when initiating connection to DataSourc...
Definition: podbc.h:370
DSN (Data Source Name) Connection.
Definition: podbc.h:781
PBoolean isAutoInc
Allows Nulls.
Definition: podbc.h:458
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
TIMESTAMP_STRUCT timestamp
Time Structure.
Definition: podbc.h:413
HENV m_hEnv
Definition: podbc.h:770
int opt
Port to connect to mySQL.
Definition: podbc.h:380
SQLGUID guid
TimeStamp Structure.
Definition: podbc.h:414
void GetLastError()
Get the Last Error This returns the Error ID & String to PODBC::OnSQLError.
PODBC * GetLink() const
Definition: podbc.h:237
This is an array collection class of PString objects.
Definition: pstring.h:2024
PString DefDir
Database file Path (not Oracle,xxSQL)
Definition: podbc.h:374
PBoolean FetchPrevious()
FetchPrevious Fetch the previous Row from current row.
PString Pass
UserName.
Definition: podbc.h:376
~PODBCStmt()
Deconstructor.
PODBC * odbclink
Definition: podbc.h:243
int Decimals
Field AutoIncrements.
Definition: podbc.h:459
TimeFormat
Standard time formats for string representations of a time and date.
Definition: ptime.h:399
DataSources
Datasources that are supported by this implementation used in the PODBC::DataSource Function...
Definition: podbc.h:333
BOOL PBoolean
Definition: object.h:102
Class to represent a directory in the operating system file system.
Definition: pdirect.h:182
int GetDBase() const
Definition: podbc.h:238
PINDEX CurRow
Record Structure.
Definition: podbc.h:539
unsigned char sbit
Double SQLDOUBLE.
Definition: podbc.h:408
unsigned char * suchar
Bit SQLCHAR.
Definition: podbc.h:409
FieldTypes
Raw SQL data type codes Refer <sql.h> SQL_* This list is not inclusive.
Definition: podbc.h:283
PFilePath DBPath
Definition: podbc.h:373
long int slint
Short Integer SQLSMALLINT.
Definition: podbc.h:406
PBoolean Fetch()
Fetch General call to retreive the next row of data.
PBoolean Query(PString strSQL)
Query function is the Main function to pass SQL statements to retreive/ add/Modify database data...
PBoolean Cancel()
Cancel the Current Statement.
LPCSTR LPCTSTR
Definition: podbc.h:118
PBoolean NewRow
Current Row.
Definition: podbc.h:540
PBoolean LongData
Number of decimal places to Round.
Definition: podbc.h:460
PODBC::Table This is the main Class to access Data returned by a Select Query.
Definition: podbc.h:553
SQLRETURN m_nReturn
Database Type connected to.
Definition: podbc.h:769
The character string class.
Definition: pstring.h:108
LPSTR LPTSTR
Definition: podbc.h:117
PODBCRecord This Class is used to analyse the fetched data and handles Data Conversion/Read Write ope...
Definition: podbc.h:809
SQL compliant Bound DataTypes.
Definition: podbc.h:400
PString User
Used with Paradox/DBase/Excel (& mySQL db)
Definition: podbc.h:375
static PTime::TimeFormat TimeFormat
Long Data Limit KBytes def = 56; (56 Kbytes)
Definition: podbc.h:929
~PODBCRecord()
Deconstructor.
Definition: podbc.h:822
Row * row
LongData Length is Required.
Definition: podbc.h:463
MSSQLProtocols
MSSQL protocols.If your interested?
Definition: podbc.h:350
This class functions as a simple wrapper of the PODBCStmt class to fetch/Save data to the Datasource...
Definition: podbc.h:476
PBoolean FetchLast()
FetchLast Fetch the Last row in the RecordSet.
PODBCRecord * rec
Definition: podbc.h:537
PString Name
ODBC Type (For saving/Conversion)
Definition: podbc.h:452
PINDEX RowCount
Flag to Indicate New Row (requires either Post or Delete)
Definition: podbc.h:541
static int MaxCharSize
Double Real Float Decimal digit rounding def= 4;.
Definition: podbc.h:928
This template class maps the PArrayObjects to a specific object type.
Definition: array.h:1024
PString Host
Whether Datasource is locked or Trusted.
Definition: podbc.h:378
PBoolean FetchNext()
FetchNext: Fetch the Next row.
FieldTypes ODBCType
pwlib Type for conversion
Definition: podbc.h:449
PBoolean FetchRow(PINDEX nRow, PBoolean Absolute=1)
FetchRow More detailed fetching of Rows.
short int ssint
Long Data.
Definition: podbc.h:405
TIME_STRUCT time
Date Structure.
Definition: podbc.h:412
PBoolean SQL_OK(SQLRETURN res)
Is the SQL Instruction OK If an Error is detected then GetLastError is called to Retrieve the SQL Err...
PODBCStmt(PODBC *odbc)
Constructor PODBC (Datasources call) or thro' DSNConnection (Connection call).
int Port
URL for Host Datasouce xxSQL.
Definition: podbc.h:379
PString sbin
Definition: podbc.h:403
PODBCStmt * Stmt
Definition: podbc.h:934
double sdoub
Integer SQLINTEGER.
Definition: podbc.h:407
PINDEX col
Column Name.
Definition: podbc.h:453
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PStringArray TableList(PString option="")
Retreive the List of Tables from the current Datasource The option field can be used to specify the T...
PBoolean isReadOnly
Column Number (For Saving/Conversion)
Definition: podbc.h:456
DATE_STRUCT date
Bit Integer SQLBIGINT.
Definition: podbc.h:411
static unsigned int Precision
Conversion Settings.
Definition: podbc.h:927