SQL Server Date field and NetworkLibrary
Posted: Sat 01 Nov 2014 17:23
I have a program with the following code:
UniQuery.SQL.Text := 'select * from Test';
UniQuery.Open;
for i := 0 to UniQuery.FieldCount - 1 do
Memo.Lines.Add (IntToStr(i) + ' ' +
UniQuery.Fields.FieldName + ' ' +
GetEnumName(TypeInfo(TFieldType),Ord(UniQuery.Fields.DataType)));
With NetworkLibrary set to prNativeClient (or prAuto) I get the following result:
0 IntColumn ftInteger
1 VarCharColumn ftString
2 DateTimeColumn ftDateTime
3 SmallDateTimeColumn ftDateTime
4 DateColumn ftDate
With NetworkLibrary set to prSQL I get the following result:
0 IntColumn ftInteger
1 VarCharColumn ftString
2 DateTimeColumn ftDateTime
3 SmallDateTimeColumn ftDateTime
4 DateColumn ftWideString
The date column has changed from ftDate to ftWideString. Is this a bug (or feature !) in the Microsoft libraries and if so is there a work around ?
UniQuery.SQL.Text := 'select * from Test';
UniQuery.Open;
for i := 0 to UniQuery.FieldCount - 1 do
Memo.Lines.Add (IntToStr(i) + ' ' +
UniQuery.Fields.FieldName + ' ' +
GetEnumName(TypeInfo(TFieldType),Ord(UniQuery.Fields.DataType)));
With NetworkLibrary set to prNativeClient (or prAuto) I get the following result:
0 IntColumn ftInteger
1 VarCharColumn ftString
2 DateTimeColumn ftDateTime
3 SmallDateTimeColumn ftDateTime
4 DateColumn ftDate
With NetworkLibrary set to prSQL I get the following result:
0 IntColumn ftInteger
1 VarCharColumn ftString
2 DateTimeColumn ftDateTime
3 SmallDateTimeColumn ftDateTime
4 DateColumn ftWideString
The date column has changed from ftDate to ftWideString. Is this a bug (or feature !) in the Microsoft libraries and if so is there a work around ?