Ok, new thread.
Recap. Got the following SQL String which returns an error 3061, though the string is properly formed.
I agree that the EmpID doesn't necessarily need the single quotes, but they don't break the query. Whether they are included in the string or not, I get the same error. The SQL engines are usually pretty forgiving if you include singles and don't need them. This seems more like some parameter is missing in the OpenRecordset call.
Is there somewhere I can test the query outside of code execution, like SQL Server's Query Analyzer?
Thanks for the help.
devRyan
Recap. Got the following SQL String which returns an error 3061, though the string is properly formed.
Code:
strSQL = "SELECT lnkCourseEmployee.EmpCourseID, lnkCourseEmployee.CourseID, lnkCourseEmployee.EmpID, " & _
"lnkCourseEmployee.DateComplete,lnkCourseEmployee.HoursTrained,lnkCourseEmployeeCompleted, " & _
"tblCourses.CourseName FROM lnkCourseEmployee, tblCourses WHERE lnkCourseEmployee.EmpID = '" & EmpID & "' " & _
"AND lnkCourseEmployee.CourseID = tblCourses.CourseID"
MsgBox strSQL
Set rsC = db.OpenRecordset(strSQL)
I agree that the EmpID doesn't necessarily need the single quotes, but they don't break the query. Whether they are included in the string or not, I get the same error. The SQL engines are usually pretty forgiving if you include singles and don't need them. This seems more like some parameter is missing in the OpenRecordset call.
Is there somewhere I can test the query outside of code execution, like SQL Server's Query Analyzer?
Thanks for the help.
devRyan