Link to home
Start Free TrialLog in
Avatar of nicholasjfox
nicholasjfoxFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Delphi/Excel connection problems

I am connecting through ADO Connection and Query to Excel workbook. I have two problems.


1/ The Excel workbook comes to me with spaces in the column titles. Within Delphi is it possible to delete the spaces or change the column names?

2/Having changed the Excel column names manually, I am able to connect and sort the workbook sheets. The workbook appears in a connected DBGrid. However, when I run the following code adoquery1.first; X:=adoquery1['fieldname'].Asstring; label1.caption:=x; I get the following error "Variant does not reference an automation Object' So I need solutions to these two problems, please.
ASKER CERTIFIED SOLUTION
Avatar of imitchie
imitchie
Flag of New Zealand 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 nicholasjfox

ASKER

Sorry I should have said the spaces in the column names are in the middle, ie "Test Results". I can't seem to do anything with the table unless I manually delete the spaces to make
"testresults".