I created a simple table with 2 fields MsAccess, a counter and a text string field 50.
connection by unidac info are: Server version: ACCESS 04.00.0000, Client version: Microsoft Office 2007 Access database engine
now i fill a record with string = '', this is the code
( all code source in http://70.85.129.85/pe/UniDacTest.zip )
Code: Select all
UniQuery1.Open;
UniQuery1.Append;
UniQuery1.FieldByName ('IdTest').AsString := '';
UniQuery1.Post;
Code: Select all
UniQuery2.Sql.Text :='Select * from Table1 Where IdTest =' + '''' + '''';
UniQuery2.Open;
MessageDlg('empty string ' + IntToStr(UniQuery2.RecordCount), mtError, [mbOK], 0);
UniQuery2.Sql.Text :='Select * from Table1 Where IdTest is null';
UniQuery2.Open;
MessageDlg('null ' + IntToStr(UniQuery2.RecordCount), mtError, [mbOK], 0);
null = 10 .. 11. .12 .
how i can resolve this problem ?
Code: Select all
UniQuery1: TUniQuery;
UniQuery1 := TUniQuery.Create(Self);
with UniQuery1 do
begin
Name := 'UniQuery1';
DataTypeMap := <>;
Connection := UniConnection1;
ParamCheck := False;
SQL.Clear;
SQL.Add('select * from table1');
end;
my add procedure is converted in
Code: Select all
INSERT INTO Table1
(IdTest)
VALUES
(?)
name:IdTest Type:IN DataType:String[0] inValue:'' OutValue:''
obviously SetEmptyStrToNull = FALSE
But the same code but with MSSQL connection works ok !
bye