troubleshooting Question

ADO and excel

Avatar of wqclatre
wqclatre asked on
Delphi
2 Comments1 Solution174 ViewsLast Modified:
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?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros