ISAPI Login action sometimes works, sometimes not...

I'm writing an ISAPI app in D5 and interbase 6.
It's working very fine except for a *little* detail: now that it's in
production
in IIS4, from time to time, the login action fails.

IOW, I have an action called login, which displays a simple login form
(fUserName
and fPassword fields).

Then, I have a dologin action, which opens a IBQuery with UserName as a
parameter.

The query will return the user's record, but on comparing the entered
password with the
users' table password it will fail ("Erroneous password"). Of course, I
tested that the password
is correct indeed.

The problem goes away as soon as I restart the IIS service....

My ideas are:
1) I'm having some problem with the transactions or the isolation level
2) IIS is failing (that takes me to ISAPI ng)

I hope you can help me, I was going to post in ISAPI NG,  but I think this
could
be some IB mistake I'm doing here. If not, this might prove an exception to
the cross-posting
rules <g>

Any idea will help...