This error started happening after a long marathon session of building and
designing. I was half dead and this was kind of the straw that broke the
camel's back. After about an hour, I realized how stupid this was. The answer
was so obvious and simple it made me sick.
You see, whenever an error happens in any function, it sends that error info
up the tree to the parent sub that called it which writes it to a log. If an
error happens in the sub, it hits on a general On Error statement and writes
that info to a log. Here is what was happening:
An error happened in a function, the error info traveled to the parent sub CO.
CO tried to write the info, but an index error resulted.
The CO general Error Handler tried to write that info, but the errorlog was
never closed, so it hit a Security Exception.
The info traveled back to my Page_Load sub which tried to do the same thing
as CO with the same result.
Solution? Add a line to close the log file if it is open and everything
works just fine again. And fix the actual error in the function that started
this mess.
Why spend this entire time typing this explanation out that you will
probably laugh at? I had another marathon session starting last afternoon and
am once again like the camel that broke the straw's back.
--
---
Tony Abate
"Kevin Spencer" wrote:
Well, based on the information you provided, I would guess that there is
something wrong with your CO method.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox
"Tony Abate" <no****@spam-b-gone.com> wrote in message
news:AB**********************************@microsof t.com... When I try to call a subroutine from my code, I get the following error:
Procedure call or argument is not valid.
I have checked to make sure that all variables are correct in their
casting
and that there is nothing that has the same name as this sub. I cannot
figure
out why this is happening. Here is the code:
21: Select Case cmd
Case "Cont"
22: slv = Request.QueryString("oid")
23: If slv = "0" Or slv = "" Then slv = "NoOID"
24: CO(slv, sid)
25: Case "FC"
26: slv = Request.QueryString("fnc")
27: FC(slv, sid)
28: End Select
The FC sub works just fine, but the CO one does not. There is absolutely
no
difference in how the two are called, but for some reason I get that
error.
If anyone has any ideas, please let me know.
--
---
Tony Abate