amol
amol

Reputation: 11

Syntax error in FROM Clause

hi all I'm working on asp.net web application & for this use MS access for back end, My Query is given below which is successfully executed on MS Access but error on front end ("Syntax Error in FROM Clause")

select USER.EMPID as EMPID,USER.FULLNAME as FULLNAME,
USER.USERNAME as USERNAME,Employee.ROLEID,ROLE.ROLENAME AS ROLE 
FROM USER 
inner join employee on user.userid=employee.userid 
inner join role on employee.roleid=role.roleid  
WHERE  USER.EMAIL='[email protected]' 
AND USER.PASSWORD='cZdqAEeDV2EVzA1JNFJ6hQ==' 
AND USER.STATUS='Enable'

Any help is greatly appreciated.

Upvotes: 0

Views: 979

Answers (3)

amol
amol

Reputation: 11

I changed the name of my user table to users & update query regarding this change & problem resolve successfully.

Upvotes: 0

Fionnuala
Fionnuala

Reputation: 91306

I am very surprised the query works for you. Access is fussy about parentheses and you are missing some:

Select USER.EMPID as EMPID,USER.FULLNAME as FULLNAME,
USER.USERNAME as USERNAME,Employee.ROLEID,ROLE.ROLENAME AS ROLE 
FROM (USER 
inner join employee on user.userid=employee.userid )
inner join role on employee.roleid=role.roleid  
WHERE  USER.EMAIL='[email protected]' 
AND USER.PASSWORD='cZdqAEeDV2EVzA1JNFJ6hQ==' 
AND USER.STATUS='Enable'

Upvotes: 1

iDevlop
iDevlop

Reputation: 25252

As a general rule, I would advise that you build your query using MS Access.
Build it in Design view, test in in Dataheet view, then switch to SQL view and copy paste SQL stqtement to you app.
This way you will avoid a lot of errors.

Upvotes: 1

Related Questions