[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 »
11,238 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 »
11,238 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 »
11,238 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.


Feb 18, 2013 at 3:41 AM // reply »
1 Comments

Thanks Ben , That was superb, saved a lot time,

MY ISSUE was , missing to feed a input button, in turn no cfif conditions in the cfquery executed



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
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 17, 2013 at 7:42 PM
HashKeyCopier - An AngularJS Utility Class For Merging Cached And Live Data
Ben - thanks so much for posting these Angular articles and findings, they've been a huge help towards learning one of the more 'complex' JavaScript frameworks out there (IMO). I have been using Angu ... read »
May 16, 2013 at 5:01 PM
UPDATE: Parsing CSV Data Files In ColdFusion With csvToArray()
Your code was the closest thing I've found to obtaining some direction for converting ISO fields to values that CF can translate properly. Thank you for posting! ... read »
May 15, 2013 at 10:37 PM
Very Simple Pusher And ColdFusion Powered Chat
hi id making plz easy ... read »
May 15, 2013 at 6:07 PM
Making SOAP Web Service Requests With ColdFusion And CFHTTP
Ben, you once again saved my bacon at work. Thank you, thank you, thank you! ... read »
May 15, 2013 at 4:15 PM
What If All User Interface (UI) Data Came In Reports?
@Josh, Thanks! @Ben, I definitely recommend the David West book "Object Thinking" I've been quoting from. It goes deeply into the philosophy and history of OO programming. His breadth ... read »
May 15, 2013 at 11:36 AM
Ask Ben: Print Part Of A Web Page With jQuery
I found this helpfull when you need to keep (refresh) the original parent page after closing the iframe child print dialog (Hoping you're not using a form at this time so it won't submit again): On ... read »
May 14, 2013 at 7:13 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, If there's any books you'd recommend on the subject of domain modelling, I'd love to hear it. I just downloaded the free PDF of "Domain Driven Design Quickly". Figured I'd give it ... read »
May 14, 2013 at 6:57 PM
The UX Of Prototyping: Low-Fidelity Is The New High-Fidelity
@Phillip, I'm not sure I follow what you mean? Are you saying that you looked at the list of widgets provided by the jQuery UI and let that be your style guide? ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools