Nicholasjf
asked on
Why does formely good SQL code in Delphi 2009 not work under Windows 10?
Simple SQL Query usuing ADO in Delphi connected to Access Database:
procedure TForm1.Button1Click(Sender : TObject);
begin
With AdoQuery1 do begin
Open;
SQL.Clear;
SQL.Add('SELECT * FROM Table1');
SQL.Add('WHERE Number='+SpinEdit1.value);
ExecSql;
end;
end;
Keeps throwing up the error: E2010 Incompatible types: 'string' and 'Integer'
Used to work fine in earlier version of Windows but every time an integer or double is used I get the same error. Thought it might have something to do with Access, but I ran the query just on Access and it worked fine. Have tried with both OLEDB 4.0 and 12.0 connections,
procedure TForm1.Button1Click(Sender
begin
With AdoQuery1 do begin
Open;
SQL.Clear;
SQL.Add('SELECT * FROM Table1');
SQL.Add('WHERE Number='+SpinEdit1.value);
ExecSql;
end;
end;
Keeps throwing up the error: E2010 Incompatible types: 'string' and 'Integer'
Used to work fine in earlier version of Windows but every time an integer or double is used I get the same error. Thought it might have something to do with Access, but I ran the query just on Access and it worked fine. Have tried with both OLEDB 4.0 and 12.0 connections,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Doesn't it answer your question?
ASKER
Fairly easy solution - it was me being dumb. But quick response and perfect answer. Thanks.
ASKER