473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Procedure Call Errors

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
Nov 19 '05 #1
2 1205
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

Nov 19 '05 #2
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Narayan Appachar | last post by:
Hi, We were able to build stored procedures without any problems till now. Now while building procedures, we are getting the following errors ------------------------------------------ Create...
4
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
2
by: GGerard | last post by:
Hello Is there a way to exit all running procedures with one command? Sometimes a procedure(1) will call another procedure(2) which could call a third procedure(3) and what I would like to...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
1
by: deepdata | last post by:
Hi, I am trying to fetch data from db2 (express version) database by calling stored procedure. I have tried to use both cursor and for loop but still i am getting error. --======Start...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
2
by: savio XCIX | last post by:
I created the following stored procedure: ======= CREATE PROCEDURE TBLNAME.proc_test (IN p_custnum VARCHAR(8), IN p_zipcode...
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
1
by: rajpar | last post by:
Environment: Solaris (client + server) db2 version 7.2 latest fixpak (DB2 v7.1.0.111", "s050516" and "U803330") Compiler: gcc Here is my SP code executed on the client: CREATE PROCEDURE...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.