0

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.

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

...in particular it will avoid Jet/ACE's pickiness about parentheses on the JOINs in the FROM clause.
1

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'

2 Comments

Would the person who down voted care to explain how they succeeded in running an ms-access query that leads to missing operator error in both plain Access and ANSI 92 mode, please? Regarding the use of the keyword user, square brackets around it will correct the problem, though renaming is preferable.
@David-W-Fenton Thanks, David. It should be helpful to readers who wonder why they cannot get away with missing brackets :D
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.