mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 01:11:29 +01:00 
			
		
		
		
	
							parent
							
								
									99b15e95a1
								
							
						
					
					
						commit
						370f7737b6
					
				| @ -497,25 +497,52 @@ begin | ||||
|   Result := False; | ||||
| end; | ||||
| 
 | ||||
| procedure TDataSet.DataConvert(aField: TField; aSource, aDest: Pointer; | ||||
|   aToNative: Boolean); | ||||
|    | ||||
| var | ||||
|   DT : TFieldType; | ||||
|    | ||||
| begin | ||||
|   DT := aField.DataType; | ||||
|   case DT of | ||||
|     ftDate, ftTime, ftDateTime: TDateTime(aDest^) := DateTimeRecToDateTime(DT, TDateTimeRec(aSource^)); | ||||
|     ftTimeStamp               : TTimeStamp(aDest^) := TTimeStamp(aSource^); | ||||
| //    ftBCD                     : ;
 | ||||
| //    ftFMTBCD                  : ;
 | ||||
| //    ftBytes                   : ;
 | ||||
| //    ftVarBytes                : ;
 | ||||
| //    ftWideString              : ;
 | ||||
| 
 | ||||
|   end; | ||||
| end; | ||||
| 
 | ||||
| function TDataSet.GetFieldData(Field: TField; Buffer: Pointer; | ||||
|   NativeFormat: Boolean): Boolean; | ||||
| 
 | ||||
| Var | ||||
|   DT : TFieldType; | ||||
|   DTRBuffer : TDateTimeRec; | ||||
|   AStatBuffer : Array[0..dsMaxStringSize] of Char; | ||||
|   ADynBuffer : pchar; | ||||
| 
 | ||||
| begin | ||||
|   If NativeFormat then | ||||
|     Result:=GetFieldData(Field, Buffer) | ||||
|   else | ||||
|     begin | ||||
|     DT := Field.DataType; | ||||
|     case DT of | ||||
|       ftDate, ftTime, ftDateTime: begin | ||||
|                                   Result := GetfieldData(Field, @DTRBuffer); | ||||
|                                   TDateTime(buffer^) := DateTimeRecToDateTime(DT, DTRBuffer); | ||||
|     if Field.DataSize <= dsMaxStringSize then | ||||
|       begin | ||||
|       Result := GetfieldData(Field, @AStatBuffer); | ||||
|       if Result then DataConvert(Field,@AStatBuffer,Buffer,False); | ||||
|       end | ||||
|     else | ||||
|       Result:=GetFieldData(Field, Buffer) | ||||
|       begin | ||||
|       GetMem(ADynBuffer,Field.DataSize); | ||||
|       try | ||||
|         Result := GetfieldData(Field, ADynBuffer); | ||||
|         if Result then DataConvert(Field,ADynBuffer,Buffer,False); | ||||
|       finally | ||||
|         FreeMem(ADynBuffer); | ||||
|         end; | ||||
|       end; | ||||
|     end; | ||||
| end; | ||||
|  | ||||
| @ -1150,6 +1150,7 @@ type | ||||
|     function CompareBookmarks(Bookmark1, Bookmark2: TBookmark): Longint; virtual; | ||||
|     function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; virtual; | ||||
|     procedure CursorPosChanged; | ||||
|     procedure DataConvert(aField: TField; aSource, aDest: Pointer; aToNative: Boolean); virtual; | ||||
|     procedure Delete; | ||||
|     procedure DisableControls; | ||||
|     procedure Edit; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 joost
						joost