Output From Sql Procedure

this question is not about SQL exactly
so, I am asking here.
how to get output from sql procedure ?
my sql p. like below
Code:

if not exists(select .....................)
set @result=0
else
set @result=1

so, how can I get @result in ASP

View Replies


ADVERTISEMENT

Stored Procedure And Output Parameters

I have developed a Stored Procedure on SQL Server 7 this is it:

ALTER PROCEDURE TestOutput
@FieldReturnedint=0 OUTPUT
AS
select @FieldReturned = 12
--print @FieldReturned
return 1001

and made a test ASP page to call this procedure on ASP page

<%
Dim CommObj, ParmObj, rsResults, strColumns
set CommObj = Server.CreateObject("ADODB.Command")
set rsResults = Server.CreateObject("ADODB.Recordset")
strColumns = 1

'rsResults.Open "TestOutput " & strColumns ,Conn

CommObj.ActiveConnection = Conn
CommObj.CommandText = "TestOutput"
CommObj.CommandType = adCmdStoredProc
'CommObj.Parameters.Refresh

'CommObj.Parameters.Append CommObj.CreateParameter("@Data", adInteger,adParamInputOutput)

'set ParmObj = CommObj.CreateParameter("@FieldReturned", adInteger, adParamOutput,, 1)
'CommObj.Parameters.Append ParmObj
Set ParamOut=CommObj.CreateParameter("@FieldReturned", adInteger,adParamInputOutput ","0")
CommObj.Parameters.Append ParamOut
'Set ParamRet=CommObj.CreateParameter ("Return",adInteger ,adParamReturnValue )
'CommObj.Parameters.Append ParamRet
'CommObj.Prepared = true

set rsResults = CommObj.Execute()
'strColumns = CommObj.Parameters("@FieldReturned").Value 'CStr(ParmObj) '

Response.Write "Returned Columns:[ " & CommObj.Parameters(0).Value & " ]"
%>

yet.......it does not type the output parameter......

it does not give an exception...just empty value for the output parameter

What do you think the problem is....?

View Replies View Related

ASP Procedure

I have the following code:

<%
Sub makeSafe(theString)
theString = Replace(theString, "'", "''")
theString = Replace(theString, chr(34), chr(34))
theString = Replace(theString, "=", "-")
theString = Replace(theString, "_", "-")
theString = Replace(theString, "../", "")
theString = Replace(theString, "--", "")
theString = Replace(theString, ";", "")
theString = LCase(theString)
End Sub
%>

I then call it using Code:

thePassword = Trim(request.Form("password"))
thePassword = makeSafe(thePassword)

but i then get an error message saying Quote: Type mismatch: 'makeSafe'

View Replies View Related

Sub Procedure

I'd like to write an ASP routine that builds a table and is called when a button is clicked (not a submit button). Is there a way to do this? Everytime the button is clicked, I want to call the procedure so another table is built. Dynamically building a new table. Code:

View Replies View Related

Getting Output Sent

How can I retrieve the output that has been sent to the client, e.g

[vbs]
<html>
<head><title>Test</title></head>

<body>
this is output
</body>
</html>
<%
Dim strContents

'Now I want to put the contents in an variable, something like
strContents = Response.Contents '(but that doesn't work)
%>
[/vbs]

View Replies View Related

Output XLS From ASP

With this line of command :

Response.ContentType = "application/vnd.ms-excel"
I can output a file in XLS format with no problem.

But on a specific server, the file pops as an ASP page. My code is fairly simple.
Does the server need to have Excel installed in order to work ??

View Replies View Related

How Do Output

How do I output an ASP variable insde of Javascript?

View Replies View Related

Output To Rtf / Doc

The problem i have in my system you can seacrh clients and then display their details. what i wanna do is find the client i want and then have a button called e.g. generate and then the asp pops up a word or rtf document with there details sloted in to a preformatted document.

Now i know i could do this by creating the doc line by line with asp on the file but is there a faster way of just inserting the asp values into placeholders in the word or rtf file which has already been setup?

View Replies View Related

Asp Output From Db

I'm having a problem controlling the output from an access db and the css two column layout. It goes like this.Left side has a connection string and outputs 3 columns of db data to the leftside of the page. There is also a conection string on the right side of the page. It outputs that db data AFTER the right side processes that data. So the page is staggered, left to right instead of displaying the results across from each other.

View Replies View Related

Output As XML

I have an ASP program. It outputs HTML with some
XML data islands in it. When I run the program, the
browser sees the HTML and doesn't work the way
I want it to. however, if I view source on the output
page, save the source as an XML file, then open the
saved file, it works properly.

How do I get the browser to treat the output from an
ASP program as XML instead of HTML?

View Replies View Related

Store Procedure In ASP?

how to write store procedure in asp?

View Replies View Related

Trying To Use A Stored Procedure

I'm trying to access a stored procedure on our AS400 that is written in RPG. I know that the stored procedure works (I've called it from an RPG program on the AS400), and I know that the connection to the AS400 is good, because this same ASP page is reading data via SQL. However, when I try to call the stored procedure, I can't tell if anything is actually happening. All that I know is that the end result is not being changed, so I suspect that the procedure isn't being called correctly.

My stored procedure is used to encrypt/decrypt data. It has 3 parameters - a 1 character flag telling it whether to encrypt or decrypt, a 25 character field for the plaintext data, and a 50 character field for the encrypted data. The last two parameters are used for either input or output, depending on the value of the first
flag (if the flag is "E", then the plaintext is used as input and the program fills the encrypted data field. If the flag is "D", then vice - versa).

Here is the code where I call my stored procedure. I'm trying to decrypt data from the queryString and place it in some program variables. I'm new to ASP, and can't find any good examples for my situation, so I pieced this together from what examples I found
online. Can anyone tell me what I'm missing?

View Replies View Related

Sql Stored Procedure

I have a problem with input parameter which has Decimal DataType. Stored procedure works but it rounds all
values, i.e 5.555 input becomes 6 and 1.3 input becomes 1.
In table QTY has data type decimal(5) - precision(8) scale(3).
Please, suggest what's wrong with this:

newqty = Request.Form("quantity")
..........
cmd.Parameters.Append(cmd.CreateParameter("qty", adDecimal, adParamInput, 5, newqty))
cmd.Parameters("qty").Precision = 8
cmd.Parameters("qty").NumericScale = 3

View Replies View Related

Procedure Confusion

I've created a procedure/query in an Access 2000 database using the
following code:
<%
strAppend = "ProcName"
strSQL = "Create Procedure [qry" & strAppend & "] AS Select * From Stories
ORDER BY StoryID DESC;"
cn.execute(strSQL)
%>

I know I have successfully created the procedure/query, because when I run
the code again, it gives me the following error:
Microsoft JET Database Engine (0x80040E14)
Object 'qryProcName' already exists.
I look in the Access database and can't find qryProcName as a query, macro
or any other object.How do I access it?

View Replies View Related

Store Procedure

i am stuck with the following error message
"Application uses a value of the wrong type for the current operation."
did anyone know the reson this occur?
just because of my store procedure....

View Replies View Related

Property Procedure

when do u use property procedure for example
PublicProperty CompanyName() AsString
Get
Return strCompany
EndGet
Set(ByVal Value AsString)
strCompany = Value
EndSet
EndProperty

View Replies View Related

Why Sub Procedure Does Not Work

I am trying to construct a sub procedure that concects to db , executes a stored procedure and returns a recordset. Connection to db and executing the stored procedure works fine.

The problem is that when I call the sub in the asp page to be executed the recordset is refused to be returned from the sub and the recordset itself does not appear to be constructed. or in another words the error displayed is: 'object required' --> refering to my recordset --> 'rs'

I do not know why, can any one tell me the reason, I tried much but with no result.
NOTE: For testing puropses I looped through the recordset isnide the sub itself and it worked fine Code:

View Replies View Related

Checkbox And Procedure

I populate my checkboxes in a table written in asp. Each checkbox has the same value but a different name. I want to say for checkbox in the asp table, call a procedure that will do the changes. Code:

View Replies View Related

ASP & Store Procedure

I have an ASP page and a Store Procedure but I keep getting this error:

[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'sp_searchresultsZIP' expects parameter '@xDateTo', which was not supplied. Code:

View Replies View Related

Stored Procedure And LIKE

how to use LIKE in a Stored Procedure ?I can use it as "where tbl LIKE @string"but it doesn't work truly.how can I use % ' & ?you know, we use LIKE in classic asp and sql as '%"&YYY&"%'.but how can it be used in Stored Procedure ?

View Replies View Related

Calling A Procedure

What I'm looking to doing is having three input boxes on a page. As an example I would like for the user to input a employee ID in the first input box and then wither press enter or onblur it would call a proceedure that would get data from an access DB and display the employees first and last name in the other two input boxes.

I know the code I need to get the data from the DB but I don't know how to call the proceedure. I'm also assuming that the only way to get and display data from the input boxes is to have them in a form. Is it possible to call a asp proceedure by pressing enter or onblur?

View Replies View Related

Sub Procedure In Global.asa

Can I create a sub procedure in global.asa file? If YES then Will that be Local to global.asa or Global for website? And can I CALL that Sub from the Session_Onstart ?

View Replies View Related

Stored Procedure

I have a stored procedure that I am executing with this SQL

osp_instrument_swap @InstrumentFrom = 'testname', @InstrumentIDTo = 37,
@Schedules = '593, 594, 596, 598, 599, 600, 601, 602, 603, 604, 605, 606,
607, 608, 609, 610, 611, 612, 613, 616'

the @Schedules are ID fields in a table that are integers. I would like to do an Update blah, Where ScheduleID in (@Schedules) instead of looping. How can I do this? I have to sent the values to the sproc as text, right? Where do I covert to the int data type and how?

View Replies View Related

Code A Sub Procedure

I have to code a sub procedure to do the further processing. I dont know how to call a VBScript sub procedure on the click event of a button. I tried a lot of thing but it is not working. Can any help me out or give a me tip on how to go to subprocedure on button click on an ASP page.

View Replies View Related

Use Stored Procedure In ASP

My below given code is running 100% but now i have to pass this SQL Query from stored procedures...

I have created the stored procedure in my database and give the parameter to the student_id

can any one temme that how can i implement this stored procedure code in my given code:

View Replies View Related

Why We Use Stored Procedure

why we use Stored procedure in VB/ASP? Why i am asking is we can do the same with SQL Query? What does this do the differnce?I need the main difference bet. these?

View Replies View Related

GZip Output

How can I send gzipped (compressed) output back to the browser, using ASP (and IIS)?

I'm looking for a function similiar to PHP's ob_start("ob_gzhandler"); function.

View Replies View Related

Output HTML

This is really puzzling me; I am developing a site for a client and have uploaded it to a remote server with ASP enabled; I and my friends do not have a problem diplaying the output HTML from my ASP statements however, my client is unable to see it. He says he can see all the other page (CSS layout) but is unable to view the content (output HTML) from my ASP statement.
Now I am clever enough to know that ASP is server side, so I cannot understand why he can't see it- and he has tried this with two of his computers.
The only possible explanation that I can come up with is that he may have Javascript disabled in his browser as my pages contain a small amount of Javascript.

View Replies View Related

Display Output

if guy can help how to output if my customer make reservation....enter everything ..etc enter first name, last name. then after click make reservation button it will come out his/her name on the page for his/her referrence ...then it will clear once another customer enter it.

View Replies View Related

Shorten A Output

This might sound stupid to you guys, ok i have this:

------------------------------------------------------------
perc = (total*100)/limit

response.write (" You are using ")
response.write perc
response.write (" % Of your 1GB")

-------------------------------------------------------------
but on the output i just need the first two digits, but i get this
You are using 21.8057899 % Of your 1GB

View Replies View Related

Output The Records

Please guide me. How can I output the records from my recordset in columns in a table? That is, instead of just one record per row in a table, how can I have multiple records per row?

View Replies View Related

Database Output

There is no error in the code but can't get output from this code;

<html>
<head>
<title>g</title>
</head>
<% set db=server.CreateObject("ADODB.Connection")
db.Provider="Microsoft.Jet.OLEDB.4.0"
db.open "C:/data/CIS_data.mdb"
VarQuery="SELECT FullName,ICNo FRoM Patient_Details"
set rs=db.Execute(VarQuery) %>
<% Do while NOT rs.EOF %>
<% rs.movenext %>
<% Loop %>
<% rs.close %>
</html>
</head>

View Replies View Related

Output Buffering

if something similar to php (ob_get_contents(), output
buffering) exists in ASP/VBscript.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved