When using the following SQL-statement within c#/OleDbCommand.ExecuteReader I get a syntax error in FROM-clause. Using exactly the same statement in MS Access directly works fine.
SELECT
s.idShots, s.shotdata, c.[original], s.[hash], comp.idCompetitions, comp.competitionsname, sh.idShooters, sh.firstname, sh.lastname
FROM (([Shots] s
INNER JOIN [ShotsCertificate] c ON c.[uuid] = s.[uuid])
INNER JOIN [Competitions] comp ON comp.idCompetitions = s.fidCompetitions)
INNER JOIN [Shooters] sh ON sh.idShooters = s.fidShooters ORDER BY s.idShots ASC
Within c#:
OleDbCommand cmd2 = new OleDbCommand("", dbc);
cmd2.CommandText = "SELECT s.idShots, s.shotdata, c.[original], s.[hash], comp.idCompetitions, comp.competitionsname, sh.idShooters, sh.firstname, sh.lastname FROM" +
" (([Shots] s" +
" INNER JOIN [ShotsCertificate] c ON c.[uuid] = s.[uuid])" +
" INNER JOIN [Competitions] comp ON comp.idCompetitions = s.fidCompetitions)" +
" INNER JOIN [Shooters] sh ON sh.idShooters = s.fidShooters" +
" ORDER BY s.idShots ASC";
log.Debug(cmd2.CommandText);
OleDbDataReader r = cmd2.ExecuteReader();
The dbc connections works fine, it's used in some previous commands and everything works.
Thanks for your suggestions!