[Macromedia][SQLServer JDBC Driver]Syntax error at token 0, line 0 offset 0

Posted May 18, 2006 at 7:30 AM by Ben Nadel

Tags: ColdFusion, SQL

I spend a good amount of time helping other people debug their code and I run into this error plenty of times:  [Macromedia][SQLServer JDBC Driver]Syntax error at token 0, line 0 offset 0. The first time I ran into it, I was helping a co-worker with a Query statement that had many CFIF statements. Having never seen it before, it took some time to figure out. Now, it's just obvious. No SQL is being passed to the database. He had so many CFIF statements with crazy logic, that none of them were TRUE and no SQL code was being evaluated.

If you ever get this, take out some logic, you probably don't need it.



Reader Comments

Feb 3, 2007 at 8:54 PM // reply »
1 Comments

I saw this error about four time (with out any cfif tags in my SQL statement) and decided to Google it. Thanks!


T
Aug 9, 2007 at 4:49 PM // reply »
1 Comments

Thanks for the help. I get this at times and fix it by looking extensively at the code, but this makes sense now.


Oct 23, 2008 at 3:22 PM // reply »
1 Comments

Great, Thanks Ben!


Nov 5, 2008 at 10:55 AM // reply »
1 Comments

This just saved me alot of time. I copied and pasted a query outside the closing cfquery tag. Duh.


Nov 5, 2008 at 10:58 AM // reply »
10,640 Comments

@Walt,

Gald to help. This is such an odd error and totally not obvious when you're looking at the ColdFusion code.


Mar 9, 2009 at 4:15 PM // reply »
6 Comments

Thanks Ben. I thought sure you were wrong on this error, but it turned out to be a missing CFIF.


May 15, 2009 at 12:47 PM // reply »
1 Comments

Was beating my head against the wall until I realized I had removed my SQL statements but not the cfquery tags themselves, and inserted a bunch of code between. Would still be looking for it if not for this post. Many thanks! :-)


May 19, 2009 at 9:27 AM // reply »
10,640 Comments

@JEBster,

Hey man, glad to help :)


Sep 14, 2009 at 9:09 AM // reply »
1 Comments

Really this saved me some hair, Thanks man


Apr 27, 2010 at 8:59 PM // reply »
1 Comments

Hye Mr Ben,

I'm very junior to ColdFusion. Came accross this kind of error and found out the solution in this page. Thanks a lot.

Eventhough my error has nothing to with so-called "Extra CFIF tag", but your posting gave me some ideas to solve it.


May 18, 2010 at 9:12 PM // reply »
10,640 Comments

@Ma,

Can I ask what your problem ended up being?


May 1, 2011 at 2:29 PM // reply »
4 Comments

Mine was caused by a cfloop having nothing to loop over in the cfquery it looks like.


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Feb 10, 2012 at 7:21 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
Update! Instead of $(eval(options.insertAfter)).after(data['insertData']); I now use: var ajaxNode = document.createElement('span'); var parent = $(eval(options.insertAfter))[0].parentNode; ... read »
Feb 10, 2012 at 6:18 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
encountered this same, what I consider, jQuery bug last week. I'm building a site in which I load some content via AJAX. This content contains Linkedin share button placeholders which Linkedin API ne ... read »
Feb 10, 2012 at 11:30 AM
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
After you understand the concepts here, this is an awesome cheatsheet for enabling CORS in just about anything http://enable-cors.org/ ... read »
JM
Feb 10, 2012 at 9:10 AM
My Safari Browser SQLite Database Hello World Example
@Amy, Here is a very good tutorial on how to use JOIN: http://www.sqltutorial.org/sqljoin-innerjoin.aspx ... read »
Feb 10, 2012 at 4:42 AM
Building A Twitter-Inspired RESTful API Architecture In ColdFusion
This is great, very useful Ben. I spotted a small typo in the api.cgm listing: <cfthrow type="Unauthroized" /> Cheers Stefan ... read »
Feb 9, 2012 at 10:35 PM
CFDirectory Filtering Uses Pipe Character For Multiple Filters (Thanks Steve Withington)
I was wondering if there would be a filter you could apply so that you got everything but what you included in the filter. As in show me all docs that are not a .pdf. ... read »
Feb 9, 2012 at 10:29 PM
Learning ColdFusion 9: Application-Specific Data Sources
@Ben, No offence, but if people were really wanting advanced features they would be using a platform like ASP.NET MVC. CFML is so structurally compromised as a tag-based scripting language that ... read »
Feb 9, 2012 at 10:03 PM
Subversion - Cleanup Failed To Process The Following Paths
@Leviaguirre, do you still have problems with this? ... read »