ColdFusion / SQL Error: Invalid Precision Value

Posted January 31, 2008 at 8:05 PM

Tags: ColdFusion

Earlier today, I was working on a project that was using an MS Access Database (sexy, I know!) when one of the queries starting throwing this error:

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft]
[ODBC Microsoft Access Driver]Invalid precision value

When I went to look at the query, which was just storing FORM data, I noticed that all of the data types in my ColdFusion CFQueryParam tags were set to CF_SQL_VARCHAR. Thanks to some advice I received months ago from fellow ColdFusion programmer, Spencer Strickland, I knew exactly what the problem was. In Microsoft SQL Server, which is what I am accustomed to, CF_SQL_VARCHAR will work for any kind of text field; however, in MS Access, CF_SQL_VARCHAR will not work with fields of data-type, Memo. For some reason, and I guess this is a driver issue, Memo fields require a CFQueryParam of sql type, CF_SQL_LONGVARCHAR.

Minor issue, but a huge ass pain if you didn't know what to look for.

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




Reader Comments

sz
Apr 21, 2008 at 3:02 PM // reply »
1 Comments

Thank you for this one. I was very close to desperation.


Apr 21, 2008 at 3:27 PM // reply »
6,516 Comments

@Sz,

Glad to have helped.


Dec 4, 2008 at 3:27 PM // reply »
1 Comments

Thank you thank you! This has been driving me nuts for a while!


Jan 18, 2009 at 3:26 PM // reply »
1 Comments

Thanks for sharing this. I think you just saved me a lot of time!!


Feb 25, 2009 at 6:04 AM // reply »
5 Comments

great thanks Ben, you saved the day again!


May 28, 2009 at 11:38 AM // reply »
1 Comments

Thanks Ben. This was a great help.


Jun 1, 2009 at 1:35 PM // reply »
6,516 Comments

@All,

Glad this helped!


Jun 2, 2009 at 1:08 PM // reply »
2 Comments

Thanks Ben! You saved my neck on a time sensitive project.


Jun 2, 2009 at 1:24 PM // reply »
6,516 Comments

@Dave,

Awesome!


Tim
Jul 14, 2009 at 11:26 AM // reply »
7 Comments

Well, this post just saved me what could have potentially taken a while to find out. Three cheers for testing locally using Access!


Post Comment  |  Ask Ben

Recent Blog Comments
Nov 21, 2009 at 6:47 PM
Hal Helms - Real World Object Oriented Development, Sarasota - Day Five
@charlie griefer, Thank you.. ... read »
Nov 21, 2009 at 5:15 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jose Galdamez, Oh heh yeah I didn't paste the whole code. I should have defined the vars -- my bad. It's fixed thou. Thanks. ... read »
Nov 21, 2009 at 4:49 PM
Styling The ColdFusion 8 WriteToBrowser CFImage Output
Great work yet again Ben! Whilst I didn't use this whole code, I copied some of your regex code for a similar problem with the lack of an alt attribute and unescaped ampersands in CFIMAGE for Railo 3 ... read »
Nov 21, 2009 at 1:13 PM
My First ColdFusion Builder Extension - Encrypting And Decrypting CFM / CFC Files
@Ben, Because I am pedantic, I just want to make sure that everyone knows there is absolutely no encryption going on. There is only encoding and obfuscation. The cfencode tool only obfuscates your C ... read »
Nov 21, 2009 at 12:28 PM
Using ColdFusion Structures To Remove Duplicate List Values
@Jody I can't seem to get your code sample to work. If you are still having problems, try this code out and see if it gets you what you wanted. <!--- Comma delimited list with various duplicates ... read »
Nov 21, 2009 at 11:03 AM
Groovy Operator Overloading Does Not Work In The ColdFusion Context
Hi Ben, Thanks for this informative post. Now I am reading ur old posts too ... read »
Nov 21, 2009 at 10:56 AM
HostMySite.com Has The Best ColdFusion Hosting
@Mehul, Yes very nice people, however several downtimes per day which was not acceptable. Hence we had to move out. I am glad you are having good luck with them so far. ... read »