SQL-statements that seem correct
-
I just had a bunch of generated SQL statements which failed. I couldn't find what was wrong and the statements succeeded when I performed them manually. It seems that Jet4 (OleDb) and ODBC have certain keywords that you can't use in your statements. (In my case it was "ACTION", but there are probably more.) For your reference: C# forum[^] Renaming the key-word in the statement will resolve this issue. Hope this can help some people :-).
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
I just had a bunch of generated SQL statements which failed. I couldn't find what was wrong and the statements succeeded when I performed them manually. It seems that Jet4 (OleDb) and ODBC have certain keywords that you can't use in your statements. (In my case it was "ACTION", but there are probably more.) For your reference: C# forum[^] Renaming the key-word in the statement will resolve this issue. Hope this can help some people :-).
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveV. wrote:
It seems that Jet4 (OleDb) and ODBC have certain keywords that you can't use in your statements.
you can also enclose your identifier in square brackets (e.g.
[ACTION]
), I use to do that to avoid worrying about identifier collisions. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
V. wrote:
It seems that Jet4 (OleDb) and ODBC have certain keywords that you can't use in your statements.
you can also enclose your identifier in square brackets (e.g.
[ACTION]
), I use to do that to avoid worrying about identifier collisions. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
tried that, but it failed. it converts it back to "ACTION". even if I do [TABLENAME].[COLNAME] Could be that I convert that in my DAL component (should check that ;P) but I don't think so.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
tried that, but it failed. it converts it back to "ACTION". even if I do [TABLENAME].[COLNAME] Could be that I convert that in my DAL component (should check that ;P) but I don't think so.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveIt works for me, with Access and SQL Server.
-
I just had a bunch of generated SQL statements which failed. I couldn't find what was wrong and the statements succeeded when I performed them manually. It seems that Jet4 (OleDb) and ODBC have certain keywords that you can't use in your statements. (In my case it was "ACTION", but there are probably more.) For your reference: C# forum[^] Renaming the key-word in the statement will resolve this issue. Hope this can help some people :-).
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveProblems with keywords in SQL is a quite common problem. There is one that is even a bit more subtle than your example, that I have seen several times: The swedish word for "lives" is "bor". This is sometimes used as a field name for the purpose of storing the name of a location where the user lives. The problem is that it's a reserved keyword as it's also the name of the not so frequently used binary or operator.
--- b { font-weight: normal; }
-
It works for me, with Access and SQL Server.
My DAL component is quite old, I created it the first time in .NET 1.0 and just recompiled it to 1.1 and 2.0 later. It might be that the adapters are a bit 'old' ;). tnx.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
My DAL component is quite old, I created it the first time in .NET 1.0 and just recompiled it to 1.1 and 2.0 later. It might be that the adapters are a bit 'old' ;). tnx.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveChances are. But I don't see why it would be removing the [ and ]