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

Posted May 18, 2006 at 7:30 AM

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.

Post Comment  |  Ask Ben  |  Permalink  |  Other Searches  |  Print Page



Learning ColdFusion 9 - ColdFusion 9 tutorials, samples, examples, demos

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 »
6,515 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 »
2 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 »
6,515 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


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 20, 2009 at 10:56 PM
Five Months Without Hungarian Notation And I'm Loving It
I use the following and love it: my.namespace.MyComponents.functionMethodsOrUDF() CONSTANT_VALUES_OR_PROPERTIES One thing I always try is to CamelCaseBuiltInColdFusionFunctions() so others can tell ... read »
Nov 20, 2009 at 5:38 PM
Learning ColdFusion 8: CFImage Part I - Reading And Writing Images
Hi Ben, Great article. I've been looking around to see if ColdFusion image engine can programatically create the following "wrap around" effect: http://www.creativepro.com/article/photoshop-s-she ... read »
Nov 20, 2009 at 5:35 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Dave: I talked to Gert he suggested: <cfhttp method="get" url="http://{some cf website}" result="stuff" addtoken="yes" /> Note the addition of cfhttp attribute addtoken. That should persist y ... read »
Nov 20, 2009 at 5:23 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Todd, Ahh, gotcha, yeah that makes sense. ... read »
Nov 20, 2009 at 5:17 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
Ben, sorry if I didn't make this clear. You can make it work like that if you want, just put <cfset session.foo = 1> (and <cfset application.foo = 1>) in your OnRequestStart() and it reve ... read »
Nov 20, 2009 at 5:07 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
@Todd, I have seen tidbits about the way Railo handles session. I can understand that it lazy-loads sessions, but I also think that I might make some things more complicated. For example, often tim ... read »
Nov 20, 2009 at 4:53 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
Ben, you can ramp up the security by turning on J2EE session which gives you a third set of numbers other than CFID/CFTOKEN. There's a reason why ACF put this in place (other than just session replic ... read »
Nov 20, 2009 at 4:52 PM
Maintaining ColdFusion Sessions Across SMS Text Message Requests Without Cookies
Case in point, Ben, you may not be aware of this, but in Railo - OnApplicationStart() & OnSessionStart() act differently than in ACF. ACF does: OnApplicationStart (1st hit) OnSessionStart (1st and e ... read »