//////////////////////////////////////////////////////////////////// // // FGODBCRecord.h // Commesse // // Created by Francesco Germinara on Mon Jun 07 2004. // // Copyright (c) 2004 SofTech di F.Germinara - www.germinara.it. All rights reserved. // // For information please contact me at info@germinara.it //////////////////////////////////////////////////////////////////// // History: // // Description: // //////////////////////////////////////////////////////////////////// #import #import "FGODBCConnection.h" #import "FGODBCFieldInfo.h" //IODBC FrameWork #include #include #include @interface FGODBCRecord : NSObject { FGODBCConnection *database; //DataBase Open Connection NSString *strTableName; //SQL table Name NSMutableDictionary *FGODBCFieldsInfo; //Store all information of fields of the record int nFields; //Number of fields present SQLHSTMT hstmt; //Handle delle Istruzioni BOOL bIsEOF; BOOL bIsBOF; } -(id)initWithDataBase:(FGODBCConnection *) dbName forSQLTable:(NSString*) strName; //Create Object: Default Constructor -(id)initWithRecordData:(FGODBCRecord *) record; //Create Object copying data from another object -(void)FillFieldInfo; //Load all fields Informations -(int)GetNumFields; //Return number of fields -(FGODBCFieldInfo *)FieldInfo:(NSString*)strName; //return a Field Info Object by Name -(FGODBCFieldInfo *)FieldInfoByCol:(int)Col; ////return a Field Info Object by Col -(NSString *)FieldName:(int)col; //Return Field Name of col (0 based) -(int)FieldLegth:(int)col; //Return Field Length of col (0 based) -(int)LoadDati:(NSString *) strFilter; //Load First Row of Data -(int)OpenQuery:(NSString *) strFilter;//Open DataBase Cursor -(int)MoveNext; -(void)CloseQuery; //Close DataBase Cursor -(long int)Count:(NSString *) strFilter; //Count record Items -(NSString *)TableName; //Return Table Name -(void)CloseCursor; //Close database handle and free resource, call before release -(void)DebugShowAllFields; //Debug Helper Only -(int)Insert; //Insert record with info fields contents -(int)Update:(NSString *) strFilter; //Update record with info fields contents -(int)Delete:(NSString *) strFilter; //Delete records -(void)AddFieldInfoName:(NSString*) colName numCol:(short)colNum typeCol:(short) colType precisionCol:(UDWORD) colPrecision scaleCol:(short) colScale nullableCol:(short)colNullable strValore:(NSString*) strValueCol; //Add Field Info Manually @end