[bug_fixed] error handling empty string values (makes NULLS)
Posted: 29.05.2007, 14:15
bug report: error handling empty string values - makes 'em NULLS
when you set field value to '' it is posted as null in ADO
I do not even want to comment this issue. In fact, it is your code and you know much more about it. The only thing I say is how does it look like now and how should it look like to work.
unit dbc\ZDbcAdoStatement.pas
original code:
patched code:
[platform notes]
zeosdbo-6.6.1-beta
protocol: ado
delphi7
Microsoft SQL server 2000
or Microsoft Access via Jet ADO provider
when you set field value to '' it is posted as null in ADO
I do not even want to comment this issue. In fact, it is your code and you know much more about it. The only thing I say is how does it look like now and how should it look like to work.
unit dbc\ZDbcAdoStatement.pas
original code:
Code: Select all
S := 0;
if SQLType = stString then
begin
S := Length(VarToStr(V));
if S = 0 then
begin
S := 1;
V := Null;
end;
end;
if SQLType in [stUnicodeString] then
begin
S := Length(VarToWideStr(V));
if S = 0 then
begin
S := 1;
V := Null;
end;
end;
Code: Select all
S := 0;
if SQLType in [stString, stUnicodeString] then
begin
S := Length(VarToStr(V));
if S = 0 then
begin
S := 1;
// no need or empty
// strings become NULLS
// V := Null;
end;
end;
[platform notes]
zeosdbo-6.6.1-beta
protocol: ado
delphi7
Microsoft SQL server 2000
or Microsoft Access via Jet ADO provider