telophase: (Default)
telophase ([personal profile] telophase) wrote2004-11-01 04:52 pm

(no subject)

My last few entries are mostly whinging and complaints because the thing that's been taking over my life currently - TEH_SEKRIT_PROJEKT - cannot be talked about. So not much happening in my life other than that. That being said, on to [Unknown site tag]today's ASP whinge

OK, the primary reason I post in my journal about coding problems is that I've discovered that often the act of writing the problem down helps me fix it. Of course, it's got to be actually sent *to* someone; I can't just type it into a random document on my computer, it seems that there must be someone to be annoyed on the other end for it to work. [1] I don't think LJ works quite as well as annoying my friend Toby,[2] but it'll have to do.

Anyway, the current problem is that in this calendar app I'm working on, it works perfectly for days that have entries on the calendar. But when there's a day *without* any entries, it throws an error when closing the recordset:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/www/sfolse/calendar_test2.asp, line 231

This is line 231: objRS2.Close

objRS2 is created for the query that pulls the events from the database, and the events on days that have them display just fine, it's just on days with no event, so that there are no records in the recordset.

I'm thinking that it's panicking because there are no records in the recordset, but I can't figure out why it would do that, and there don't seem to be any explanations in my books or online that say "If your recordset is empty, do XXX." So it's entirely possible I'm wrong.

[1] I think that it probably has to do with forcing myself to explain it all from the beginning when writing to another person - when writing for myself, I bet I take shortcuts or something that keep me from being able to work through the logic.

[2] Toby: Why are you asking me this? You know more PHP than I do!
Me: Shut up. That's not the point.



OK, 5:00, time to go home and plunge back into TEH_SEKRIT_PROJEKT

[identity profile] sarekofvulcan.livejournal.com 2004-11-02 12:54 am (UTC)(link)
Eh, shoot me a copy and I'll see if I can figure anything out. Email in userinfo, I believe...

[identity profile] telophase.livejournal.com 2004-11-02 03:08 pm (UTC)(link)
Doesn't seem to be in the userinfo, but if the one at the bottom of your webpage linked from there is current, then it should be there momentarily. :)

[identity profile] messyah.livejournal.com 2004-11-02 01:02 am (UTC)(link)
have you tried checking to see if the result set is null when there are no results? so you're trying to call ''.Close?

[identity profile] telophase.livejournal.com 2004-11-02 03:06 pm (UTC)(link)
I haven't tried that because I haven't the slightest idea how at the moment, or what to do if it is.

[identity profile] selenite.livejournal.com 2004-11-02 04:46 pm (UTC)(link)
There's always the brute force approach--toss a dummy event onto every day and delete it if there's a real event.

[identity profile] telophase.livejournal.com 2004-11-02 04:51 pm (UTC)(link)
I've been starting to consider that. Theoretically, there will be an entry *every* day because the library hours will be on there every day, even if it says nothing but "CLOSED". It just bothers the fool out of me that I can't figure out what's going on. :)

I can't even get IF [IF NOT] (objRS2.BOF AND objRS2.EOF) THEN [blah] to work, in any permutation. It's just totally not creating the recordset object if there's no records, instead of returning a recordset object with 0 rows.

You know, a few months from now, maybe even jsut a week from now, I'll be looking back on this and going "But that's so /easy/! Why didn't you see it?" but for now ... aarg.