Microsoft OLE DB Provider for SQL
Server error ‘80040e14’The column prefix ‘tblUsers’ does not
match with a table name or alias name
used in the query
The query being executed is:
SELECT tblProjects.projectName, tblUsers.username
FROM tblProjects
INNER JOIN
tblUsers ON tblProjects.userID = tblUsers.ID
WHERE (tblProjects.ID = 190)
When I run this in SQL Server 2005 though, it runs fine and returns the correct result! In my code, this throws the error.
It is being invoked through a classic ASP script:
strSQL = "SELECT tblProjects.projectName, tblUsers.username FROM tblProjects INNER JOIN tblUsers ON tblProjects.userID = tblUsers.ID WHERE (tblProjects.ID = " & lngProjectID & ")"
rsCommon.open strSQL, adoCon
strProjectPath = "../projects/" & rsCommon("username") & "/" & rsCommon("projectName")
rsCommon.close
Personally I do not see any reason why this would throw error. Query and the code seems fine. Can the problem be somewhere else? You can try adding brackets as suggested by @Micheal. Hope that works.