I have the following working SQL statement in Access 2007
DLookUp("[AnswerQ1]","Data","[QuestionFormat]='STEP2' AND [ID]=" & Chr(34) & [ID] & Chr(34))
When I run the query from C# program, I get the following error
ERROR  [Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression
'DLookUp([[AnswerQ1]],[Data],[[QuestionFormat]='STEP2' AND [ID]=] & Chr(34) & [ID] & Chr(34))'
I'm primarily a VB coder, so I think that is why I have this problem.
I'm assuming I'm using VB syntax here in this SQL statement, where I should be using C#. I assume the problem is with the Chr(34) and & usage.
Can anyone help with proper syntax?