Recent Posts

Coldfusion cfqueryparam of type decimal, cf_sql_decimal, requires the scale argument

I learned the hard way that if you don’t include the scale attribute in the cf_sql_decimal cfqueryparam tag, then your decimal gets rounded to the nearest whole number. IF this isn’t what is intended, this can really bite. Make sure you specify the scale with the scale argument to make you cfqueryparam as accurate as intended.

<cfqueryparam cfsqltype="cf_sql_decimal" scale="8" value="#decimalvar# />

WRONG (Unless whole numbers desired):

<cfqueryparam cfsqltype="cf_sql_decimal" value="#decimalvar# />

Export using Access into SQL Server or some other database

Summary – In Access, select your table and then do File->Export->ODBC Option (The last one)

I was missing the mysql table dumps that you can do from phpmysqladmin when my task at hand was to import an access table of postal codes (with their corresponding lat/long coordinates) into a SQL Server database. I decided to go nuts and attempt the task blitzkrieg style with no googling or research first. After only a minute or two looking at save and export options I found the following gem:

File->Export->ODBC Option (The last one)

If your access database is on the same machine as your SQL Server just blast through the ODBC setup menu choosing localhost, and then choose the default database as the database where you want the exported table to appear.

Or if you want to the exported table to appear in a remote sql server database (or any kind of ODBC compatible database I suppose), I think you can specify the ip or host name for that database. Then you choose a table name for your exported table and the thing will appear in your default database!

Fortunately, a few weeks ago I had needed to figure out how to set up an ODBC connection on a server box. Info: ODBC sources are like middlemen for apps to connect to a database. Set these guys up in Admin Tools->ODBC in windows if you are using about any language to access a database. So if the language requires a database connection and there aren’t any built in andd fast easy functions, you can set up connections using ODBC functions.

Cursor not showing up on Firefox form inputs (no cursor in earlier versions of Firefox)

THIS FIX DIDN’T WORK FOR FF ON A MAC. I’m still baffled about how to fix this. I think put a link for a firefox update may be the best solution.

When you select an input in FF <= 2, the blinking cursor wasn’t showing up on a form that was buried in a few layers of divs. No cursor was showing up at all, though some inputs had a half cursor (like it was pushed up off the input).

Looks like FF 3 is okay, but the older versions were acting funny. I guess this is a bug in firefox. I don’t know exactly how the bug works, or what the fixes are, are even what the different causes of the bugs are. There are tons of variations on those 3 items. All I know for me is that by doing the following it fixed the problem:

Wrap each input in <div style=”overflow:auto”></div>.

That fixed it for me. overflow:visible also worked. Overflow hidden has been mentioned as working too, but that broke it again for me. Not sure what the implications of these stylings are on how the inputs display, but they seemed to work fine for me.

jQuery Dialog error in IE7. Runtime error: invalid argument

So if you’re using jQuery UI dialogs, you may run into issues with IE 7. Apparently the value of a usually ‘undefined’ javascript variable can get set to ‘NaNpx’ in IE7. I had to change the jQuery base code to get a dialog ui component to work.

I was getting the following runtime error: “Line: 1102 Error: invalid argument.”

This error comes from code around line 1101 in jquery-1-2-6.js.

So I think my version of jQuery had already been modified or comes from an older or different source. My code follows, but the most recent 1-2-6 jQuery script has code that is like the comment Dom left (thanks – that code looks more like the most recent release of jQuery).


/* MODIFIED 7/31/08 BY NATE
* WAS THIS, but IE7 was throwing an error
if ( value != undefined )
elem[ name ] = value;
*/
if ( value != 'NaNpx' && value != undefined)
elem[ name ] = value; //NATE - Sometimes the value would come up as NaNpx in
IE and causes an error

jquery runtime error for dialog

Firefox Plugins (Adblock Plus) cause images not to load

So I had an image that was not loading, and could not figure out why, in Firefox 3. Turns out it was a plugin, mos tlikely adBlock plus. When all plugins were disabled, the image loaded fine. Here were the URLs which the plugins blocked, and the one it let by.  Looks like the plugin blocks certain URLs based on specific words.

Always worked:

<img src="http://mydomain.com/comm/cmainpromo.jpg" alt="test">

Only worked with plugins disabled:

<img src="http://mydomain.com/comm/ads/siteads/cmainpromo.jpg" alt="test">
<img src="http://mydomain.com/comm/ads/cmainpromo.jpg" alt="test">

CFML is NOT the Cambodian Midget Fighting League

I’ve noticed a lot of confusion about the acronym CFML (Coldfusion Markup Language) in connection with the other well-known acronym CMFL (Cambodian Midget Fighting League). The CMFL had an incident where an African lion defeated, and killed many of 42 midget fighters in a government sanctioned fight, which resulted in an increased status in the already popular league. Consequently, many coldfusion developers should be aware to use the proper tags and extensions that use CFM and not CMF, as such similar and popular acronyms are bound to clash often. I have already come across such errors often in my limited dev experience.

Summary: CF developers, don’t let the CMFL take precedence in your mind over CFML.

http://www.lionvs40midgets.uk-directory.com/lionvsmidgets.htm

With Internet Explorer, Javascript setAttribute(‘style’, ‘something’) doesn’t work in IE

If you try and set the style attribute of a DOM element with Javascript, the following code WON’T WORK IN IE:

yourelement.setAttribute('style','left:150px; top:150px;');

Instead use:

yourelement.style.cssText = 'left:150px; top:150px;';

Thanks to Rob on this page

http://www.quirksmode.org/bugreports/archives/2005/03/setAttribute_does_not_work_in_IE_when_used_with_th.html

http://blog.throbs.net/