Viewing by month: September 2009

Sep 21 2009

Coldfusion 9 CFMEDIAPLAYER Tag

I just have to say that this is the ugliest video player i have seen.  Come on Adobe....The media player in flex/flash is better looking that this thing

0 comments - Posted by Steve Onnis at 11:18 PM - Categories: Coldfusion

Sep 21 2009

Bloated Coldfusion UI Components

I have been messing around with some of the Coldfusion UI components and i have to say i am pretty dissapointed with how bloated these libraries are.

The first one i am going to mention is the <CFFILEUPLOAD> component. It is a single swf embed component yet there are 750Kb of javascript library files that get included, 600Kb of which is a "ext-all.js" file.  This is a bit rediculous if you ask me.  There has to be a better way to determine what javascript gets included in the request rather than just throwing everything in there.

The other one i will mention is <CFMESSAGEBOX>.  Again the same amount of javascript to do such a minimal task.

I can appreciate that a lof of these things might be directed at "non develoepers" but i can't understand the amount of effort that does into these sorts of functionality when there are more pressing functionality items that are going to be more useful for developers.

The other thing that has anoyed me about this tag is that they are using an attribute to pass in the content of the box rather than using an open/close tag method and putting the content between them.

0 comments - Posted by Steve Onnis at 10:42 PM - Categories: Coldfusion

Sep 19 2009

Custom ColdFusion Virtual Mappings

I recently has a requirement to create a shared resource across all of my coldfusion hosting customers for an undelivered cfmail spool processing application.  What i didnt want to have to do is create a webserver based virtual directory for each customer because that meant when new customers came on board i would then have to create the virtual directory for them also.

Pre Colsfusion MX, Coldfusion Mappings used to be able to be accessed via the URL but now that is not possible so another means of doing this sort of thing is needed.  Then i got to thinking...there must be a way to do it because thats how the CFCHART url is done as well as the flex/flash gateways as well as the WEB-INF path.

After hunting around in the xml server config files i came across a configuration file located at "[cf-root]\wwwroot\WEB-INF\jrun-web.xml".  This file holds virtual mapping configurations for the Coldfusion server.

To add your own virtal mapping all you need to do is add your own <virtal-mapping> entry.

  <virtual-mapping>
    <resource-path>/{name-of-path}</resource-path>
    <system-path>{absolute-path-to-directory}</system-path>
  </virtual-mapping>

 With the system-path entry, you need to use "/" in the path rather than "\", so if your path is "C:\inetpub\wwwroot\my-folder" you would enter "c:/intput/wwwroot/my-folder".

1 comments - Posted by Steve Onnis at 12:53 PM - Categories: Coldfusion | Coldfusion Server

Sep 18 2009

Reading Excel Spreadsheets with MSSQL

I recently had to change some Excel spreadsheet reading code that uses the MSSQL OPENROWSET function to read and query Excel spredsheets. In MSSQL2000 this worked no issues but because of the updated security on MSSQL2005, the bulk operations are disabled by default.

For example, to query a spreadsheet this is what i would use

<cfquery datasource="dsource" name="xlsData">
SELECT *
FROM OPENROWSET (
'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database={pathToSpreadsheet}',
'Select * from [{SheetName}$]'
)
</cfquery>

Using this method you can query any excel spreadsheet as long as your application is running.

Recently i tried to do the same thing on a MSSQL2005 server and it didn't work. After researching and googling i found that for this process to work you need to enable the "Ad Hoc Distributed Queries" option on the database server as this is disabled by default. You need to enable this to be able to perform any BULK operations such as text file importing. There is no GUI to enable this so you need to run it within the Query Analyser using the "sa" user and run this query

sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO

After you do this you then also you will also then need to check the Windows Registry and look for the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Providers\Microsoft.Jet.OLEDB.4.0

and make sure you have a REG_DWORD entry named "DisallowAdhocAccess".

If you do, it needs to be set to 0.
If don't you need to add it in and set it to 0.

After that you should be able to perform your bulk operations such as querying spreadsheets.

2 comments - Posted by Steve Onnis at 1:13 PM - Categories: Coldfusion | MSSQL Server

Sep 18 2009

Bout time to blog!

Well i have finally decided to start up a blog to jot down my thoughts and experiences, triumphs and tribulations and share them with the world.

I hope i can impart some useful information to you all.

1 comments - Posted by Steve Onnis at 12:25 PM - Categories: General