1

In the process of moving an existing (and previously working) site from Windows Server 2003 to Server 2008, jumping from IIS6 to IIS7, I have come across this oddity:

OpenSQL("SELECT * FROM bookings WHERE apartment_id = '" & strApartment & "' AND BookDate = #" & SwitchDate(dDate) & "#")

When run, the above SQL script only returns rows if there is no leading zero in the date. For example, it will return rows if the date is 10/01/2010. But it will not return rows if the date is 01/01/2010. Instead I get this error:

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

I'm not very familiar with ASP at all (in this instance running VB I believe, though it me be classic ASP - I'm not sure how you tell?). But this is a very simple request and I can't understand what is going on. I have tried removing the switchdate function (which removes all leading zeros), and playing with the syntax, all to no avail.

The Access DB holds the records in the format 01/01/2001.

4

1 に答える 1

1

ACE および Jet データベース エンジンはあいまいな日付リテラルも明確な形式を受け入れるため、あいまいな#xx/yy/zzzz#日付リテラルを処理することは事実ですが、最善の解決策は、これらの形式のいずれかを返すように関数を更新することです。mm/dd/yyyyyyyy-mm-ddyyyy/mm/ddSwitchDate()

于 2013-05-29T13:38:45.890 に答える