Just a few remarks for the new TZMemTable component:
- ftMemo, ftString, ftFixedChar will throw a nullpointer exception upon opening:
Code: Select all
ZMemTable1.FieldDefs.Add('MyField', ftString);
ZMemTable1.Open;
Code: Select all
else if Current.DataType in [ftMemo, ftString, ftFixedChar] then
ColumnInfo.ColumnCodePage := GetTransliterateCodePage(Connection.ControlsCodePage)
Code: Select all
else if Current.DataType in [{$IFDEF WITH_FTWIDEMEMO}ftWideMemo, {$ENDIF}
ftWideString{$IFDEF WITH_FTFIXEDWIDECHAR}, ftFixedWideChar{$ENDIF}, ftMemo, ftString, ftFixedChar] then
ColumnInfo.ColumnCodePage := zCP_UTF16;
- The above also renders the condition in : 217 useless, as it will never be true:
Code: Select all
if (Connection <> nil) and (Connection.Connected)
then AConSettings := Connection.DbcConnection.GetConSettings
With that said, I have the following code:
Code: Select all
ZMemTable1.FieldDefs.Add('MyField', ftString);
ZMemTable1.Open;
ZMemTable1.Append;
ZMemTable1.FieldByName('MyField').AsString := 'Hello, world!';
ZMemTable1.Post;
The reason is, ConvertDbcToDatasetType sets the fieldtype as WideMemo, if there is no length specified. I can see the reason, just want to ask if it is intended?
Code: Select all
ZMemTable1.FieldDefs.Add('MyField', ftString, 200);