[Macromedia][SQLServer JDBC Driver]Object has been closed.

I got this error for the first time today, while trying to get a query working in ColdFusion 8.01. I'd defined some custom functions in SQL Server, and tested them out through the SQL Server Management Studio, but the datasource user didn't have the right permissions to use the queries. I added the permissions, reloaded the page and got smacked with the following error:

[Macromedia][SQLServer JDBC Driver]Object has been closed.

I found the solution on House of Fusion: restart your ColdFusion services. Something about the lack of permissions seems to catch in CF, and wont be released until you restart.

 

Envisioning Information

Cover of Envisioning Information by Edward R. Tufte

I'd actually ordered this book on Amazon before I read a reference to Edward R. Tufte in Slide:ology, and so I was immensely happy when I finally got my copy in the mail. Envisioning Information is packed with rich examples of presenting complex, layered data in ways that are usable and even visually pleasing. I recommend this book to any one interested in usability and interface design.

Be warned though, that this book is dense with ideas, explanations, and images. It reads more like my college biology text book than a normal design book, and the vocabulary is often times as complex. Reading this book can be daunting, but so far, the value I've gotten back out of it has been immense.

I think my only complaint about this book is that it is beginning to become dated. Written in 1990, Tufte spends most of his time talking about designs created for printed media, and the examples of computer displays seem very primitive by today's standards. Luckily, media is no impediment to the concepts in Envisioning Information; "flatland" and "chartjunk" are the same if on a poster or on the web.

 

Utility Function: PatternExtract()

Yet another Pattern based utility function. PatternExtract() takes a pattern and gives you make a structure with values based on the groups. Additional function arguments (beyond pattern and string) are used to determine the keys (in order) that match with the groups.

<cffunction name="PatternExtract" output="false" returntype="struct">
    <cfargument name="pattern" type="string" required="true" />
    <cfargument name="string" type="string" required="true" />

    <cfset var returnValue = StructNew() />
    <cfset var array = Duplicate(arguments) />

    <cfset ArrayDeleteAt(array, 1) />
    <cfset ArrayDeleteAt(array, 2) />

    <cfif IsSimpleValue(arguments.pattern)>
        <cfset arguments.pattern = CreateObject("java", "java.util.regex.Pattern").compile(arguments.pattern) />
    </cfif>
    
    <cfset local.matcher = arguments.pattern.matcher(arguments.string)>

    <cfif local.matcher.matches()>
        <cfset local.groups = local.matcher.groupCount() />
        <cfloop from="1" to="#local.groups#" index="x">
            <cfset returnValue[array[x]] = local.matcher.group(x) />
        </cfloop>
    </cfif>

    <cfreturn returnValue />
</cffunction>

I coded this in a hurry, so yeah its a little sloppy. I'll try and update this post with a more refined version.

 

Utility Function: QueryAddRowData()

This one probably isn't original, but I wanted to be able to add whole rows to query sets in a simple manner. The built in functions let you add new columns in a simple way, but not new rows. Thats kind of weird, since I'd think that people would want to add rows more often the columns. QueryAddRowData() is designed to be flexible in its allowed inputs, working with structs, arrays, and lists.

<cffunction name="QueryAddRowData" access="public" output="false" returntype="void">
    <cfargument name="query" type="query" required="true" />
    <cfargument name="data" type="any" required="true" />
    <cfargument name="delimiter" type="string" required="false" default="," />
    
    <cfset var local = StructNew() />
    
    <cfif NOT (IsArray(arguments.data) OR (IsStruct(arguments.data) AND NOT isObject(arguments.data)) OR IsSimpleValue(arguments.data))>
        <cfthrow errorcode="QueryAddRowData" message="Invalid data for argument data. Valid types are array, struct, and string." />
    </cfif>
    
    <cfset QueryAddRow(arguments.query) />
    
    <cfif IsArray(arguments.data)>
        <cfset local.columns = ListToArray(arguments.query.columnList) />
        <cfloop from="1" to="#ArrayLen(local.columns)#" index="x">
            <cfset QuerySetCell(arguments.query, local.columns[x], arguments.data[x]) />
        </cfloop>    
        
    <cfelseif IsStruct(arguments.data) AND NOT isObject(arguments.data)>
        <cfloop collection="#arguments.data#" item="column">
            <cfset QuerySetCell(arguments.query, column, arguments.data[column]) />
        </cfloop>
    <cfelseif IsSimpleValue(arguments.data)>
        <cfset local.data = ListToArray(arguments.data, arguments.delimiter) />
        <cfset local.columns = ListToArray(arguments.query.columnList) />
        <cfloop from="1" to="#ArrayLen(local.columns)#" index="x">
            <cfset QuerySetCell(arguments.query, local.columns[x], local.data[x]) />
        </cfloop>    
    </cfif>
    
    <cfreturn />
</cffunction>

Please note that with arrays and lists, the data must be ordered as it would be in the Query.columnList (alphabetically).

 

Utility Function: IsTime()

My company often splits up date and time entries on forms, and then concatenates them back together on the back end. This is fine, except the time inputs are prone to errors, as IsDate() seems to be the only built in check to see if a string is a time, and it matches on things that are not purely times. To get around this, I create a new check: IsTime().

 

Slideology

Cover of Slide:ology by Nancy Duarte

I've fallen in love with Slide:ology by Nancy Duarte. This book covers just about everything you could want to know about how to design effective slide based presentations. If you have delivered a presentation or ever will deliver one, this book is for you. Whats even better is that even if you'll never deliver a presentation in your life, then this book might still be for you.

While focused on presentations, the concepts and insights in Slide:ology are very easily ported to the world of web design: make your point as clearly and simply as possible; images can speak louder then words; colors, fonts, images, everything contributes to the messages you are conveying to your audience.

Daurte also backs up the guidelines with tons of examples, both in terms of visual ideas to inspire you and in real-world examples of individuals who have employed specific techniques to deliver their message. Give it a spin and see what the world of Power Point can offer web designers.

 

More Entries

Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.