updating Excel file using ADO
Hi
I'm updating Excel file using ADO(Ole db provider for jet 4.0)
I'm using a command object
the code goes like:
function UpdateCodes(Dn, CT, CB: string): boolean;
begin
with TADOCommand.Create(nil) do
begin
Connection := dtm3DI.conXls;
CommandText := 'Update details set [Type T Code]= :CT, [Type B
Code]= :CB where [Domain Name] = :Dn';
CommandType := cmdText;
Parameters.ParamByName('Dn').Value := Dn;
Parameters.ParamByName('CT').Value := CT;
Parameters.ParamByName('CB').Value := CB;
Execute;
result := true;
end;
end;
I'm working with delphi5.
when I look at the results in the Excel file, I see that if I select an
updated cell (using click,arrow or tab), then copy to the clipboard the
value from it,I get the write string value I thought was updated. However,
double clicking the cell or looking at the formula bar, expose a singl
quot(')that some how was added to the cell's value.
In my application I also use the same variables to update MSSQL Sever tables
ortext file, and there is no ' before.
How did it come to the Excel?
thanks
Yaacov