Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

ADO error: Incorrect syntax near 'TABLOCKX'.

Posted on 2012-03-21
13
1,699 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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
 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

789 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