Wednesday, August 06, 2008

This is what happens when you

Error code 0x800a0e7a with the message: Provider cannot be found, It may not be properly installed.

Essentially this is a fancy way of telling you a few things.
1. Stop using ADODB - switch to OLEDB
2. Stop using Microsoft JET 4.0 in your connections. I mean geez, ACCESS??? for cripes sakes.
3. If you are stubborn and need to ignore #1 and #2, then go to the Application pool settings in IIS 7.0 on your server and enable 32-bit support. I know, it's like only using 4 cylinders on your new Ferrari, but what are you gonna do?
4. Also, download the hotfix for Microsoft JET 4.0 (you have to call in to get this..)

bummer - Oh well, this is why you blog - so you only have to figure these things out once.

Wednesday, July 30, 2008

So I wrote this monster query that I'm pretty proud of. The data is in a MS access database so that explains some stuff, but the challenge was like this:
  • AR Data is in three tables: ARCustomers, ARSummary, and ARDetail. ARcustomers is self-explanatory, ARSummary is a table with the invoice data (total, date, invoice number, etc.), and ARdetail is a payment table with amount, posting date, etc. The tables are linked by indexed fields in each one.
  • I needed a report that broke down invoice date and amount outstanding as of a "cutoffdate' so the parameter of this query is cutoffdate. Essentially I needed to see what the current billing looked like on any given date.
  • every "summary" record gets one corresponding customer record. But customers can have multiple summary records (multiple invoices)
  • Every detail record has one corresponding summary record but each summary record can have multiple detail records. Why they didn't use the invoice number is beyond me...
So I made an ado connection called ADOCONN and connected to the database. Then I created an ADO Recordset called ADORS and I opened it using this query:
SELECT s.customer, s.customername, s.invoice, s.summaryid, s.total, s.invoicedate, d.totalpaid, s.balanceowed, s.lastpaymentdate FROM (SELECT a.balanceowed, a.lastpaymentdate, a.customer, a.invoice, a.summaryid, a.total, a.invoicedate, c.customername from arsummary as a INNER JOIN arcustomers as c ON a.customer = c.customer where invoicedate <= #" & Cutoffdate & "# and total <> 0 AND invoicedate >= (SELECT MIN(postingdate) from ardetail)) AS s LEFT JOIN [SELECT sum(amount) as totalpaid, summaryid from ardetail WHERE PostingDate <= #" & Cutoffdate & "# GROUP BY summaryid]. AS d ON s.summaryid = d.summaryid WHERE (s.total <> d.totalpaid OR isnull(d.totalpaid))

It returns 9 fields: customer, customername, invoice, summaryid, total, invoicedate, totalpaid, balanceowed, and invoicedate. The total paid field basically gives me the payment information as of a cutoff date. Also, no invoices printed after the cutoff date are included. Works pretty well, but it goes a bit slowly on big tables.

Tuesday, July 29, 2008

A couple of truths about drupal:
1. Drupal as a CMS NEEDS and idiot proof content editing box. And don't tell me to use tinyMCE. We need a good one. So many times, a page has tanked because of misunderstood tags. The problem with tinyMCE or FCK is that you really can't have native php or html code in your body text because the text editor will screw it up.

2. Drupal needs javascript for a lot of its good stuff.

3. Drupal is very fun, but I'm a little worried that I'm missing out on some of the really advanced stuff. but that is why I am hacking away at this site.

Monday, December 10, 2007

So I made a small adjustment to /modules/node/node.module and it serves to display an attachment in the body of the story and the teaser. It only works if the mime type of the attachment is JPEG, GIF or PNG. So here goes:

Put this code into the node.module file at about line 1015 or so (right after the $content = drupal_render($node->content) stuff is.

//CORE HACK - BY Rob - If there is an attachment that is an image, then I will put it in.
$querystr="SELECT filepath from files WHERE status=1 AND (filemime='image/jpeg' OR filemime='image/gif' OR filemime='image/png') AND fid in (SELECT fid FROM upload WHERE nid='".$node->nid."')";
$result=db_query($querystr);
$thisarray=db_fetch_array($result);
if ($teaser) {
$imgwidth='150px';
}
else {
$imgwidth='300px';
}
if($thisarray['filepath']) {
$thisimg="
";
}

Then don't forget to prepend $thisimg to $content and $teaser in the subsequent code.

if ($teaser) {
$node->teaser = $thisimg.$content;
unset($node->body);
}
else {
$node->body = $thisimg.$content;
unset($node->teaser);
}

and then the css needs something like this:

#storypic { padding:15px; width:300px; float:right; border: thin solid #FFFFFF; background-color: #FFFFFF; }

Friday, October 06, 2006

So I was surfing television tonight and there was a Dateline or Primetime special about sexual predators. http://www.msnbc.msn.com/id/3032600/. Here's the deal - it was sponsored by all these slasher movies like SawIII and Texas Chainsaw Massacre.

My disgust was with the hypocrisy. Here was this show ostensibly offering (albeit as "newstertainment") this story of the basest of all human flaws; pedophelia. And to pay for it, they were feeding the beast they condemned. Vice sells in the fake-news biz, and no vice is more vile than victimizing children.

Thursday, October 05, 2006

When did it become so wrong to believe in something?

Hi, and welcome to my blog. I'm just going to start talking here and discuss some issues that have been on my mind lately. These topics will be mostly spiritual in nature; specifically, I'm interested in political and social ramifications of spiritual orientation (or vice versa).

The news is full of the religious right-wing going off on gay marriage, abortion, war, taxes, prayer in schools, public Christmas trees, and whatever they can manage to feel threatened about. The counterpoint is a bunch of secular fundamentalists going crazy about every mention of religion in the public square. Their search for a Stalinist secular atheocracy is just as reprehensible as the right's oppressive sledgehammer of moralizing legislation. I'd like to take a sober view of the entire social and spiritual landscape, and -since this is my blog - I will. And if no one listens, so be it.

My view is that there is a balance that is attainable between social responsibility and faith. We live in a VERY intolerant society. There is a canon to which we are all forced to adhere. Succinctly put, that canon is:

"You cannot dispute that we all essentially worship the same god and follow the same moral creed. If you do, you are intolerant and 'forcing your views on me.'"

I wonder when it became so wrong to believe something specific and different from your peers. Am I not allowed to think that I am right and that someone else is wrong?

Sunday, October 01, 2006

What's up with the name?

The name is from a puzzle I did in college. It was some kind of a word code deal, and the clue was "Something a bottle might say" and the bottle said (after about 2 hours of decoding) "If you label me, you negate me." So that's it.