Link to home
Start Free TrialLog in
Avatar of wqclatre
wqclatre

asked on

ADO and excel

TADO Query and excel.

I have one column in excel containing:

Hubba
1234

qry:= TADOQuery.Create(nil);
qry.ConnectionString:= 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + ExtractFilePath(Paramstr(0)) + '\Book1.xls'+ ';Extended Properties=Excel 8.0;Persist Security Info=False';
  qry.SQL.Text:= 'select *  from  [mysheet$] ;
  qry.Open;
  while not qry.Eof do
  begin
    ShowMessage(qry.FieldByName('myfield').AsString);

it shows Hubba for the first record. But every record that contains numeric becomes empty.

How can i correct this?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wqclatre
wqclatre

ASKER

Thanks!!!!!