Page 1 of 1

problem with msaccess dac

Posted: Sat 14 Jul 2012 05:37
by carlonarcisi
ODBC convert empty string to NULL ?

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;
if I want to check what i have inserter ...

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);
empty string = 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;
I've added dbMonitor support.
my add procedure is converted in

Code: Select all

INSERT INTO Table1
  (IdTest)
VALUES
  (?)
Parameters
name:IdTest Type:IN DataType:String[0] inValue:'' OutValue:''

obviously SetEmptyStrToNull = FALSE

But the same code but with MSSQL connection works ok !

bye

Re: problem with msaccess dac

Posted: Tue 17 Jul 2012 09:29
by AlexP
Hello,

Thank you for the information.
We've reproduced the problem.
We will notify you as soon as we have any results.

Re: problem with msaccess dac

Posted: Wed 18 Jul 2012 15:08
by AlexP
Hello,

We have fixed the problem.
This fix will be included in the next build.

Re: problem with msaccess dac

Posted: Wed 18 Jul 2012 16:35
by carlonarcisi
hi alex
When you have planned the new build ?
I can download a beta?
bye

Re: problem with msaccess dac

Posted: Thu 19 Jul 2012 10:13
by AlexP
hello,

The next build will be available next week.