Main | July 2004 »

June 30, 2004

Smart database querying

victorian.jpg
I've seen a lot of questions lately about "how can I get all rows that match 'X' and display them. More often than not, these questions involve partial matching of a value.

Things like, "all the entries for a specific month" (or year). Of course, you can write queries that embed functions to split date fields into months (or whatever the situation might be), but it seems that most people are not cognizant of one critical factor:

These queries cause "table scans".

Table scans are slow. They read every stinkin' row in the table and perform a calculation. Bleahh!

If you need to search the data a certain way, insert it into the database so that you can lookup the values directly. For dates, store the rows with separate year, month, day columns.

You will also make the application less dependent on one particular database implementation (they all seem to have their own set of functions which are different from everyone else's). So, when you find that Access is isadequate (which should take you about 3 days to figure out), you can switch to mySQL with minimal pain and rewriting.

Posted by donb at 08:00 AM | Comments (0)

June 29, 2004

Bunnies!

bun4.jpg
Bunnies, everywhere. Thankfully, the nest is now empty and I can again mow the yard without too much worry.

Posted by donb at 08:00 AM | Comments (0)

June 27, 2004

Sunday, another week starts

Butterfly.JPG
Sunday: Time to get out and take more pictures.

Posted by donb at 08:00 AM | Comments (0)

June 26, 2004

Sorters - obvious solution

GT8K3793_psp_2x1.JPG
For as long as I've been using CodeCharge Studio, I've been aware that I needed two clicks most of the time when I want to sort a grid on some column.
The "light bulb" came on finally, and it dawned on me that the "right way" to define a sorter is to set the "forward" sort order to "desc". No, this does not result if both forward and reverse sorting the same "desc" way - it means the first click on the header will sort oldest/highest-numbered items to the top, and the second click sorts newest/lowest-number items to the top.
Suddenly I no longer have to click the header twice. D'oh! Sometimes the simplest things are hardest to see.

Posted by donb at 08:00 AM | Comments (0)

June 25, 2004

Datasources and Forms

wildflower.JPG
Wouldn't it be nice to have to build only one grid for your application? I'd think so. I have dozens of grids that all do the same thing. They all look alike, the same types of sorters, data rows, navigator.
What's different is the source of data, the number of columns displayed, and the type of controls.
Heck it would be nice to declare a datasource and specify "show it as a grid", "show it as an editable grid", etc.using the same layout. It sure would save me a lot of repetitive drudge work.

I'd guess the same concept would apply to record forms.

Of course, this would automatically "morph" the form to include the columns of the datasource fed to it. This would be useful for situations where certain security groups have access to all fields and others don't - the data source could be a query and based on the security level, the query changed. Thus, the displayed columns would also change.

Posted by donb at 08:00 AM | Comments (0)

June 24, 2004

Accelerator Keys

IMG_1419_small.JPG
Continuing the Wishlist stream of conciousness...

So why did the C# keybindings change?

While reading the above item on a .NET blog, it hit home with respect to CCS. How annoying it is that I have to press CTL+F8 to quick-publish a page (when I routinely do that as my "default")?

Wouldn't it be nice if I could define my preferred set of key bindings (like Visual Studio 2005 is going to do)!

Posted by donb at 09:00 AM | Comments (0)

June 23, 2004

Change Management

GT8K3812_psp_crop_small.JPG
As the size of my projects grow, the problem of maintaining control is becoming harder and harder to deal with.

What would be nice is a control panel of sorts for recording the last-edit, last-publish and even version numbers of each file in the project. At the very least, something that would jog my memory about what I've changed. I might work on 4-5 pages then publish. I really object to "publish all" because of (1) how long that can take and (2) I might have several pages "under construction" and not ready for release.

Come to think of it, a publish/don't publish option would be great. I'd want this to work not only on files but on entire folders.

When CCS does it's publishing function, a better indicator of what was published would help a lot. Tying this back to the version idea, the indicator could say something like "Version 1.4 replaced with Version 1.5 on http://someURL.com". Saving this to a file (or providing a facility to write a database) would be SO nice.

Posted by donb at 09:34 AM | Comments (0)

June 22, 2004

Pesky Session Timeouts

GT8K2274_small.JPG
It's annoying to have the Session yanked out from under you when you take too long to click "Save". This happened to me a lot because I'd think, type, think, and POOF I could not save the final version.

Codecharge Studio saves the login information in Session variables. Webservers have typically got a timeout defined for the session. This is a good thing because you don't want "dead" sessions hanging around forever.

But, my website seemed to always drop the session at inopportune times. I think my ISP reboots the server or something like that because often the session dies in a couple minutes.

Anyway, I figured out a way around this problem. I edited the function CCSecurityAccessCheck in Common.asp. In there, before anything else, I check the cookies for my login (I remember the username and password by putting them into persistent cookies). If the cookies are set, I call CCLoginUser() and provide it the username and password in the cookies. This means CCSecurityAccessCheck succeeds even if the session is reset.

Problem solved!

Posted by donb at 09:55 PM | Comments (0)