Re: Join problem i Access



Thanks, must have done an error while cutting and pasting....

regards, Mikael


"Brian Bushay TeamB" <BBushay@xxxxxxxxx> skrev i meddelandet
news:llivd2lmn4qr6mi28k0rsj10c6lfi3bs2s@xxxxxxxxxx

Hello!

Im running the following query on an Access database:

ADOQuery.Close;
ADOQuery.SQL.Clear;
ADOQuery.SQL.Add('Select AE.UnitID, AE.ChannelID,
AE.AlarmCreationDateTime,
AT.AlarmTypeName, AL.AlarmDescription, AE.AlarmText');
ADOQuery.SQL.Add('From ((AlarmEvents AE');
ADOQuery.SQL.Add('Left Outer Join AlarmTypes On AlarmTypes.AlarmType =
AE.AlarmType)');
ADOQuery.SQL.Add('Left Outer Join Alarms On Alarms.AlarmID =
AE.AlarmID)');
ADOQuery.SQL.Add('Order By AlarmEventDateTime Desc');
ADOQuery.Open

And it gives me an exception with "undefined error".
When I run the same query from within Access it executes without
problem...

Any ideas?
I don't see where you have defined the Alias AL that you use in the Select
clause. If you are going to alias tables it is best to alias all the
tables.



--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx


.



Relevant Pages

  • Re: Join problem i Access
    ... Im running the following query on an Access database: ... ADOQuery.SQL.Add('From ((AlarmEvents AE'); ... ADOQuery.SQL.Add('Left Outer Join Alarms On Alarms.AlarmID = AE.AlarmID)'); ... When I run the same query from within Access it executes without problem... ...
    (borland.public.delphi.database.ado)
  • Re: Help with TableAdapter
    ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... the sql into the Access database from the TableAdapter, ... Access database for any particular query? ...
    (microsoft.public.dotnet.languages.vb)
  • Join problem i Access
    ... Im running the following query on an Access database: ... ADOQuery.SQL.Add('From ((AlarmEvents AE'); ... ADOQuery.SQL.Add('Left Outer Join Alarms On Alarms.AlarmID = AE.AlarmID)'); ... When I run the same query from within Access it executes without problem... ...
    (borland.public.delphi.database.ado)
  • Re: Help with TableAdapter
    ... Here's the query: ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... debug what the command is sending to the Access database for any ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with TableAdapter
    ... Here's the query: ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... sql into the Access database from the TableAdapter, ...
    (microsoft.public.dotnet.languages.vb)