Solved

ADO error: Incorrect syntax near 'TABLOCKX'.

Posted on 2012-03-21
13
1,682 Views
Last Modified: 2012-06-27
Microsoft Office 2010 using an .adp file to connect to a SQL Server 2008 R2.

When trying to make modifications (increasing column size, setting/removing PK's/identity) we randomly come across the following error:


ADO error: Incorrect syntax near 'TABLOCKX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.

This did not start occurring until these databases were moved from SQL Server 2005 (and upgraded using RESTORE) to SQL Server 2008
0
Comment
Question by:PatrickLabbett
  • 6
  • 4
  • 2
13 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 37749814
"This did not start occurring until these databases were moved from SQL Server 2005 (and upgraded using RESTORE) to SQL Server 2008"

Sorry to ask but are you sure? As far as I recall this was introduced since SQL 2005 where table hints require WITH in front of the TABLOCKX(or NOLOCK,...) or any other hint. This was a change since SQL 2000 to 2005.
0
 
LVL 39

Expert Comment

by:lcohan
ID: 37749834
Here's one link to support that but regardless - you must change your code to fix that syntax error as there is no workaround or "wrapper" that you could use as far as I'm aware:

http://blogs.imeta.co.uk/sgoodman/archive/2008/12/16/539.aspx
0
 

Author Comment

by:PatrickLabbett
ID: 37749926
We are using Access projects ( Somefile.adp) that connects to SQL Server 2008. This error occurs when using "Design view" and making changes (ranging from increasing the size of an nvarchar column or setting a identity/pk.) The error comes up when trying to save the change in Access.

We can't "change the code" as it's happening through the Access Design View interface.

We never saw anything related to TABLOCKX previous to moving the databases to SQL Server 2008. Databases that still reside on our SQL 2005 server are not experiencing this issue.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37750606
it's happening through the Access Design View interface.
Than consider using SSMS to make changes instead of MS Access.
0
 

Author Comment

by:PatrickLabbett
ID: 37751019
Our staff are restricted to using Access as SSMS isn't necessary for their normal workflow, leaving the chore of our senior IT staff to resolve it. We are trying to avoid that timesink.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 250 total points
ID: 37755578
Our staff are restricted to using Access as SSMS isn't necessary for their normal workflow
I guess you have found an exception to that rule here.  In any case good luck.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:PatrickLabbett
ID: 37767584
Unfortunately, as mentioned, that isn't possible. These employees do not know SQL. It's outside their core ability, training, and workflow. This is why we need Access for them to make simple changes. I will continue to search for an answer.
0
 

Author Comment

by:PatrickLabbett
ID: 37779496
Microsoft has replied with the following information:

http://social.msdn.microsoft.com/Forums/en-US/accessdev/thread/e07ee680-55fc-4d43-95b6-7696d16c714f/

Hi Patrick,

So, I was able to reproduce the error message you were seeing when trying to modify the design of your table in an ADP connected to SQL 2008:  "-Unable to modify table.  ADO error: Incorrect syntax near 'TABLOCKX'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax."

We have filed this issue and the developers will be continuing to investigate it.  At this point I would recommend continuing to use the workaround you currently have or giving users SQL management studio so they can make design changes directly in SQL Server.

Thanks,

Kirk

Kirk Beller

Microsoft Online Community Support
0
 

Author Comment

by:PatrickLabbett
ID: 37779501
While this did not resolve the actual issue I was trying to fix, Microsoft has confirmed that it's an issue with their product so the only way to fix the issue (as opposed to working around it) is to wait for an update to their product line.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37779888
Since the chances MS will fix this in the near future if ever, you may want to consider changing the database compatibility level to 80 (SQL Server 2000, the last time this syntax was supported.  I have tested with this setting and it does work with the deprecated syntax.
0
 

Author Closing Comment

by:PatrickLabbett
ID: 37801811
I've regraded, and based on the "Grading Tips":

If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information, or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. (Note: The use of a C in a vindictive manner is likely to be changed by a Moderator.)

I have found the C grade to be the most appropriate since the answer did "lack finality or do not completely address the issue presented."
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37808867
SouthMod,

Don't worry about the points awarded in this thread.  This is the first question the author has posted and I am sure with time he/she will get a better understanding of how it works here.  Sometimes educating users takes time.

Thanks,
Anthony
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
My experience with Windows 10 over a one year period and suggestions for smooth operation
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now