• Home
  • About George
  • Contact Me
Blue Orange Green Pink Purple

Microsoft Access – Random Identity Seeds and @@Identity

So I discovered a few things with Microsoft Access recently. It’s not my database of choice, but it’s very easy in my current work environment to use it effectively – and effectiveness is always the key. So we have been discussing more and better ways to implement security. One of the ways [...]

Read More 1 Comment   |   Posted by George
Jan 19

Giving a shout out

One of the things I like the most about the Internet is the ability to find stuff that people had put up there ages ago that is still relevant to what you are trying to do today. I was looking for a way at the end of last week to delete some duplicates that had slipped into a SQL Server database of mine. Using this script provided by David VanDeSompele: http://www.sql-server-performance.com/articles/dev/dv_delete_duplicates_p3.aspx, I was able to clean them up very easily. Thank you Internet!

Read More 0 Comments   |   Posted by George
Nov 10

PCI Compliance and Portcullis

So we’ve been doing a little bit of PCI Compliance work here at the office. One of the things that we found that really helped us out was a program called Portcullis – http://www.codfusion.com/blog/post.cfm/portcullis-cfc-filter-to-protect-against-sql-injection-and-xss. I suppose it’s not a full program, but a CFC to assist in how you do your security. We used it to help secure a site and meet our requirements. Much less expensive than some of the other web application firewalls out there, since it’s free :)

Read More 2 Comments   |   Posted by George
Oct 26

What a crazy time

So I’ve been meaning to post all kinds of things lately, and before I can remember to do them, I forget. That’s what happens when new children arrive as I’m being reminded of. Trying to find time to do the things you want to do when you have twins and a two year old just don’t happen. I also feel that a great deal of this blog is missing my personal flair, so more of that is going to come out. I hope that it will attract some readers as well as when I add more of the development items in that I have in mind. No more waiting for the big long post though!

Read More 0 Comments   |   Posted by George
Aug 05

Guest Post: cftransaction & multiple datasources

I ran across an interesting error today regarding cftransactions and multiple cfqueries inside of them.
The resulting error was

The root cause was that: java.sql.SQLException: Datasource names for all the database tags within CFTRANSACTION must be the same.

This seems pretty straightforward, until you start digging into the problem, and become led down a few wrongs paths courtesy of google serving up results that aren’t entirely true.
One of the discussions I found was an adobe tech note, which I discovered via a link from a post by Ben Nadal.  In this tech note, the solution was to simply replace all cfexit tags, with a cfabort.

Simple, yes, except that I had NO cfexit tags within my cftry/cftransaction statement, they were already cfaborts!

Further investigation revealed that you simply cannot have multiple datasource names withing a cftransaction.

Now, with no actual documentation on the subject, and not actually knowing what spell coldfusion is uttering while it waves its wand over its magic hat, I cannot give a ‘good’ reason as to why.  All I know is the problem was fixed once I removed the offending query to outside the cftransaction.

In order to duplicate the desired effect, you will have to keep track of the transactions, and rollback/commit based on the prior cftransaction attempts, which is a discussion for another post.

-Dave

Read More 0 Comments   |   Posted by superdave
Aug 05

Guest Post: structDeleteAt() doesn’t play nice with webservice returns

Sooner or later, we all experience it.  The chill runs down our spines, and we stare at the computer screen, not knowing whether to cry or curse at the cryptic error that rears its ugly head and laughs at us.

What I’m referring to is, of course, coldFusion deciding that it only wants to do things a certain way, regardless of how you *think* the process should go.

Not too long in the distant past, I encountered such a beast, and will relate my story now.

The task was simple:  connect to a webservice, and display the results.  As the project progressed, the rules changed slightly – now I needed to grab the results, and filter out any that didn’t belong based upon a criterion set.  Never you mind that usually, the web service would be changed or manipulated so that a parameter or two could be passed in & perform the filtering on the server side.  That wasn’t a possibility in this case, and wouldn’t prove to have been near as much fun.

The rumblings and mutterings from the nether world began when I attempted to loop over the results and filter out any which didn’t fall within the specified criteria.  Normally, this would just involve a cfif tag to test each set of returned data to decide to display it or not.  The crux of the problem was that before entering the loop, the count of how many records were returned was displayed.  Depending on how many records were excluded, this count could be, and was, way off of the actual records that were displayed.

My initial theory was to loop over the record set returned from the webservice, and use a structDeleteAt() call to remove any records which did not match what I was trying to display.

*KABOOM*

ColdFusion refused to delete the record.  I tried everything.  Setting the value to empty, using a Javacast to set it to null, even copying the returned result set, and working with the copy.

None of it worked.

ColdFusion liked how the returned result tasted, and wasn’t about to let go, not for any amount of cajoling or cursing at it.

Finally, defeated, I tried a different approach.  Instead of using any trickery, or established CF functions or methods, I decided to bring a howitzer to this knife fight.

The answer lies in the code below.

<cfloop from="#ArrayLen(serviceReturn.contacts.anyType)#" to="1" step="-1" index="i">
<cfset tmp = serviceReturn.contacts.anyType[i] />
<cfset tmpPaidThrough = tmp.getPaidThrough() />
<cfif EXPRESSION_TO_CHECK_AGAINST >
<cfset tmpInsert = arrayappend(session.searchResults,serviceReturn.contacts.anyType[i]) />
</cfif>
</cfloop>

To explain:

  • loop over the record set returned by the webservice.
  • set the record to a temp variable, and get the part that we want to check against (in this case, paidThrough)
  • if the record passes the test, append it to a new variable (session.searchResults)
  • note that I have gone from the end of the struct to the beginning, but I believe it would work either way

Then, in the display portion of the code, instead of using the returned record set, we use the new variable we set up that only has the records in it that have passed the test for display purposes.

*VOILA*

ColdFusion, realizing that it has been defeated, slinks off to haunt some other poor soul.

I’m not entirely sure why CF would not relinquish the record of the returned set.  In discussion with other developers, we reasoned that perhaps since the return was a struct of struct of structs, somewhere in the vast underlying java mysteries, the pointers could not be moved or deleted, so CF did not want to delete the data.  Copying the returned structure resulted in a structure of the same design, so CF wasn’t able to delete from a copy any more than it could from the original record set.

So there you have it.  Wipe the blood off your sword, hoist a beer, and move on to another realm, full of it’s share of demons and battles.

-Dave

Read More 0 Comments   |   Posted by superdave
Jul 20

CFGoogle – Now that’s neat

So I stumbled across this on my twitter feed while reading what Ray Camden had put up about the rework of the riaforge.org backend to incorporate the CFGoogle api interface written by Todd Sharp. It looks really need and could provide a great deal of use to us ColdFusion junkies out there. I say check it out!

CFSilence:
CFGoogle

RiaForge:
http://cfgoogle.riaforge.org/

Read More 0 Comments   |   Posted by George
Jun 29

DefaultProperties for ColdSpring Bean Factories

So I was playing with the defaultProperties configuration as mentioned on several sites, including this article by Dan Vega that got me going down the path. I wasn’t able to get it working at first, until I did a little messing around. Turns out that this:

1
2
3
      <entry key="devFilepath">
               <value>${baseFilepath}\logs</value>
      </entry>

Won’t work. The ColdSpring engine won’t find this as a configuration to populate. Instead, you have to make sure the whole space between the tags is what you want to have replaced, like so:

1
2
3
      <entry key="devFilepath">
               <value>${devFilepath}</value>
      </entry>

Hope that helps someone out!

Read More 0 Comments   |   Posted by George
Jun 17

datefield cfinputs and _f is undefined

So there have been two occasions I’ve run into this error on a page – and it’s very ambiguous and hard to track down both times I’ve experienced it.  Fortunately, both times have also involved a very easy solution once I looked through the page for the 40th time.  The first time I encountered this, the previous form designer had named both cfforms on the page the same thing.  While this worked, it’s never advisable.  By doing this, the cfcalendar script could not locate the item because it couldn’t track down the form properly.

The second time I ran into this – just a few moments ago – was the same problem surfacing because the declaration for the form had been placed inside the declaration for the table.

1
2
3
<table>
         <form></form>
</table>

This just did not sit well with the browser, being invalid and all.  Once I moved them outside of that formation and made it this:

1
2
3
<form>
      <table></table>
</form>

it worked like a champ.    Hopefully this helps someone out there with this error in the future!

Read More 2 Comments   |   Posted by George
Jun 01

Flash Builder 4 and ColdFusion for Flex

Saw this video through a link provided by Hal Helms (@halhelms) on Twitter.   Really interesting stuff about using the new Flash Builder 4 interface to import Coldfusion CFCs directly and then once you have them imported, wire them right into your Flash piece without writing any Flex code at all.

http://snurl.com/j7e56

Read More 0 Comments   |   Posted by George
May 14

Microsoft Access Truncating Memo Fields

Okay – so today one of the previous sites I had worked on was having difficulty because text was being truncated on a display section.  I looked in the database and sure enough all of the data was there, but when I ran the query that was on the page, I noticed that it was cutting off the data at about string length, 255 characters.  After some quick digging around, I came across this website:  http://allenbrowne.com/ser-63.html.  Well wouldn’t you know it.  I had a DISTINCT operator in my query, which was causing the field to be truncated down to string length.  Now that problem is solved, on to the next!

Read More 0 Comments   |   Posted by George
Previous Page 1 of 3

Web Development By George

  • Pages
    • About George
    • Contact Me
  • Tags
    Access Ajax asp.net ColdFusion coldspring cross browser CSS Databases Design errors firefox Flash Flex html ie7 JavaScript Merge Model-Glue PCI Compliance Personal server monitor split function Subclipse Subversion tab tabview web service YUI
  • Archives
    • February 2010
    • January 2010
    • November 2009
    • October 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
  • Search




Add to Technorati Favorites

Bad taste download movie A dog s breakfast download movie Entropy download movie Away we go download movie Once upon a time in mexico download movie Moon 44 download movie The escapist download movie Clubbed download movie Illegal Aliens download movie I Think I Love My Wife download movie I Capture the Castle download movie Hoodwinked! download movie Hatchet download movie Ghetto download movie Fantasia/2000 download movie F/X download movie Everything You Always Wanted to Know About Sex * But Were Afraid to Ask download movie Donkey Xote download movie Day of Wrath download movie Bad taste download movie A dog s breakfast download movie Entropy download movie Away we go download movie Once upon a time in mexico download movie Moon 44 download movie The escapist download movie Clubbed download movie
  • Home
  • About George
  • Contact Me

© Copyright Web Development By George. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

Back to Top