I am trying to learn SQL. I have a simple test program that reads an Access database and empties all of the fields except 1. I have an ADOConnection, an ADOQuery, a DataSource component and a DB Grid. The Access database has a Table 1 and a Table 2. This problem is with Table2. I do not use a Query on Table1. The DBGrid Query statement is:
SELECT Week, DateName, WeekName, Visitors, Collect, UnResolved
FROM Columbia-Test.mdb
The DBGrid displays the fields correctly.
My code is as follows:
procedure TForm3_SQL.Button_Run_1Click(Sender: TObject);
begin
With ADOQuery1 do
begin
Active := false;
SQL.Clear;
SQL.Add ('Table2');
SQL.Add ('UPDATE DateName = '', WeekName = '', Collect = 0, Visitor = 0, UnResolved = ''');
SQL.Add ('FROM Table2');
ExecSQL;
end;
end;
I get the following error:
Cannot run the project unless a host application is defined. Use the Run|Prameters… dialog box.
Where am I going wrong?
SELECT Week, DateName, WeekName, Visitors, Collect, UnResolved
FROM Columbia-Test.mdb
The DBGrid displays the fields correctly.
My code is as follows:
procedure TForm3_SQL.Button_Run_1Click(Sender: TObject);
begin
With ADOQuery1 do
begin
Active := false;
SQL.Clear;
SQL.Add ('Table2');
SQL.Add ('UPDATE DateName = '', WeekName = '', Collect = 0, Visitor = 0, UnResolved = ''');
SQL.Add ('FROM Table2');
ExecSQL;
end;
end;
I get the following error:
Cannot run the project unless a host application is defined. Use the Run|Prameters… dialog box.
Where am I going wrong?