473,769 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to return value from server.execute call

I am trying to replace a huge chunck of code that currently I incorporate
with an #Include directive. The program rarely has to flow through that
code, so I thought it would be better if I used Server.Execute.

I found I can pass data TO the called asp file by creating an HTML <input>
and erading it after I get there.

However, I also need to read back ONE variable that the called file must
set. I cannot figuer out how to do that. My backup positions are (1) I can
keep on using the #Include technique, and (2) I can use a database to bridge
the gap.

BUT... Isn't there a way to carry data BACK TO the calling asp file FROM
THE CALLED asp file?

I certainly do appreciate the help!

Thanks,

Jim

Aug 5 '07
17 7148
you are correct..
Aug 6 '07 #11
my bad, all page scope variables are not handled, see Dave's comment below.
Aug 6 '07 #12
Jon Paal [MSMD] wrote on 06 aug 2007 in
microsoft.publi c.inetserver.as p.general:
my bad, all page scope variables are not handled, see Dave's comment
below.
Jon, what are you refering to?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 6 '07 #13
Jon Paal [MSMD] wrote on 06 aug 2007 in
microsoft.publi c.inetserver.as p.general:
you are correct..
Jon, what and who are you referring to?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 6 '07 #14
"Evertjan." wrote:
>you are correct..

Jon, what and who are you referring to?
Me. And my post about what *IS* shared among scripts when Server.Execute( )
is used.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Aug 6 '07 #15
"Evertjan." wrote:
>my bad, all page scope variables are not handled, see Dave's
comment below.

Jon, what are you refering to?
Evertjan, you really ought to give it a rest. I may be your only defender in
here, and even I tire of the constant policing.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Aug 6 '07 #16
Dave Anderson wrote on 06 aug 2007 in
microsoft.publi c.inetserver.as p.general:
"Evertjan." wrote:
>>my bad, all page scope variables are not handled, see Dave's
comment below.

Jon, what are you refering to?

Evertjan, you really ought to give it a rest. I may be your only
defender in here, and even I tire of the constant policing.
Dave, I think this is nonsense. Why even you?
I am just asking. If you think that is policing, so be it.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 6 '07 #17
"Jim Rodgers" <Ji********@dis cussions.micros oft.comwrote in message
news:C8******** *************** ***********@mic rosoft.com...
"Anthony Jones" wrote:

For this scenario the next step from an include file is a VB6 dll. Of
course for various reasons that may not be an option.

For an include file that contains a large set of functions enclosing
them in
a class helps to keep the global namespace free.

Server.Execute is not an appropriate solution.

How have you determined that having a large include file is a problem?

--
Anthony Jones - MVP ASP/ASP.NET

Thanks, Anthony!

I have not yet determined that having a large include file is a problem.
I
may keep what I have until it is a problem. However, I am not only
creating
a specific web application, but I am trying to keep my options open for
code
reuse since the project is turning into a decent platform for more work.

Your idea about a VB6 DLL is excellent. I am planning to replace a lot of
my #Includes (containing my VBScript Subs and Functions "library") with a
DLL
soon. But it will make more sense to you and everyone if I mention one
more
aspect of the problem I have in the current case.

The subject asp file (which currently is #Included and which I would
prefer
to be Server.Execute' d) processes a huge number of Request.Form(i)
variables
for all kinds of input validation requirements. It is because of the
Request.Form(i) variables that I felt Server.Execute would be a good
choice.
I hate having to pass all these TO the CALLED file.
What can't the function you call get the form values from the Request
object?
Since no one could tell me about [an obscure] technique for getting one or
two answers back to the CALLING script, I have decided to write the
validation results to a database. Thus, I need only to check the database
when I return to the first file. Previously, I acted on the validation
results (with Response.Write' s) in the CALLED file. Now I will simply do
that after I return. Even though the second file now does no output to
the
client side, it still makes sense to use Server.Execute because of the
sheer
volume of Request.Form(i) variables.

Would you agree?
No. The volume of values is not a problem there are numerous solutions to
this.

The appropriate approach is a function call and/or the use of Classes.

The fact that you need to jump through ugly hoops to attempt to force a
server.execute into a function call semantic (ie you want it to return a
value) indicates that it's not the right tool for the job.

--
Anthony Jones - MVP ASP/ASP.NET
Aug 6 '07 #18

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

Similar topics

3
22928
by: Vipul Pathak | last post by:
Hello Friends ! I have the Following Code, that Executes a Stored Procedure and Attempt to read a Returned Integer Value from the StoredProc. But It gives Error ... ADODB.Command (0x800A0BB9) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /C4U/DBOutputParameterTest.asp, line 25
4
23497
by: Paul | last post by:
Hi, In SQL Books Online in the section on @@Error it gives the following example: -- Execute the INSERT statement. INSERT INTO authors (au_id, au_lname, au_fname, phone, address, city, state, zip, contract) values (@au_id,@au_lname,@au_fname,@phone,@address,
6
6529
by: Hardy Wang | last post by:
Hi all, I have the following codes, but SCOPE_IDENTITY() just returns NULL to me. If I comment out SCOPE_IDENTITY() line and run @@IDENTITY line, it works fine!! Since I have a trigger on the table, I have to use SCOPE_IDENTITY(). Any ideas? SqlConnection conn = new SqlConnection(connectionString); conn.Open(); //Create the dataadapter
7
1930
by: Rudy | last post by:
Hello All! I have a value in a textbox(txbTableIDm.Text ) that I would like to use in a paremiter in a SP I wrote, and then have the select statement work off that parememter, retireive a diffrent value in another(txbCredits) texbox. Heres the code: Public Sub GetCredit() Dim ConCred As SqlConnection Dim strCred As String Dim cmdCred As SqlCommand
8
2230
by: solomon_13000 | last post by:
The code bellow functions well. However if I want to obtain a return value using the code bellow, how is it done? <% Sub RunQueryString (pSQL,parms) on error resume next Set conn = Server.CreateObject("ADODB.Connection") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/upload/stelladb.mdb") & ";" Set cmd = Server.CreateObject("adodb.command")
4
2219
by: Mick Walker | last post by:
Hi Everyone, I am stumped here. I have the following stored proceedure:P CREATE PROCEDURE . @SupplierSKU varchar(50), @RetVal int AS Select @Retval = count(*) from dbo.ImportLines Where = @SupplierSKU
3
4148
by: gopi2ks | last post by:
Dear All, I have one stored procedure like sp_insertEmployee Employee Table Fileds Eno int pk, ename varchar(100), designation varchar
12
5141
by: Dooza | last post by:
I have a stored procedure that takes a number of inputs, does a bulk insert, and then outputs a recordset. When I run the stored procedure in Server Management Studio I also get a return value from the stored procedure which is an INT. I want to access this return value on my ASP/VBScript page, but do not know how to access it. Here is my code so far:
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10208
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9987
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7404
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.