user2938704
user2938704

Reputation:

SQL with ASP Classic (Syntax error in FROM clause.)

I am recieveing the error below when I try to run this SQL, no idea why and been stuck at it for a while now, can any of you spot the problem

 Microsoft Access Database Engine error '80040e14'

 Syntax error in FROM clause.

 /student/s0190204/wip/group-add.asp, line 54

It says the error is on line 54 which i marked out. However the problem is likely from the SQL.

comd.ActiveConnection=conx
    set userRs=server.CreateObject("adodb.recordset")
    groupcheck="SELECT * FROM Group"
    54> userRs.Open groupcheck,conx, adOpenkeyset, AdLockOptimistic

Thanks for all help!

Upvotes: 1

Views: 340

Answers (2)

Michael Berkowski
Michael Berkowski

Reputation: 270767

GROUP is a reserved keyword in most RDBMS. Surround it in square brackets to use it as a table or column identifier in MS Access, thereby distinguishing it from GROUP BY.

groupcheck="SELECT * FROM [Group]"

Upvotes: 2

Haji
Haji

Reputation: 2087

Group is a keyword in most database. so use another name for your table

or you can use the query as SELECT * FROM [Group]

To learn more about the reserved keywords in sql server,

Reserved Keywords List

Upvotes: 2

Related Questions