Post Param From Asp To Sql Stored Proc
I am trying to run the following t-sql stored proc from my VBScript page
Create Procedure getUserInfo
(
@login nvarchar(8)
)
AS
USE proj_dashboard
SELECT f_forename, f_surname, f_profile_id
FROM t_users
WHERE f_login = @login
basically I wasnt to pull in the login of the user pass it to the proc and pull out the info for that user. I use the following sql statement Code:
View Replies
ADVERTISEMENT
I need to also add an AND after the where like
WHERE (Id = @CId)
and MAX(end) < NOW()
CREATE PROCEDURE dbo.[sp_rsgroup]
@Id int
AS
SELECT ISNULL(Group, '') AS GroupCalc, MIN(start) AS START, COUNT(Id) AS Count
FROM Table
WHERE (Id = @CId)
GROUP BY ISNULL(Group, '')
ORDER BY start
GO
View Replies
View Related
What is the simplest way to open up a stored query in Access - I'v got this far but I need to open: qry_Listings.
set cnn = Server.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("../database/listings.mdb") '//This one is for Access
2000/2002
cnn.Open strCon
View Replies
View Related
as I'm in the process of performance tuning, I'm trying to receive a NUMBER type array from a Stored Procedure.I made a VARRAY OF NUMBER in my stored procedure. I'm not able to receive this in a Function in ASP.
View Replies
View Related
I would like to call my stored proc and invoke the WITH RECOMPILE option. I can't figure out what to set in ADO to make that happen. how to make this work? BTW, I _don't_ want to create the stored proc using the WITH RECOMPILE.
View Replies
View Related
I need to open a Recordset with a dynamic cursor from a Stored Proc. Does anyone have the syntax?
View Replies
View Related
I am trying to pass a VBScript Date variable as value to an ADO adDate
parameter of a stored procedure (which runs in an SQL Server).
If I add the parameter like this:
oCmd.Parameters.Append oCmd.CreateParameter( "@p_Date", adDate,
adParamInput, , dParam)
where oCmd is of type ADODB.Command and dParam is a VBScript variable of
type Date
then when trying to execute the stored procedure I get the following error:
Optional feature not implemented
I was able to get round this by passing a string value in an adVarChar
parameter, but it would be easier and more readable with adDate and
Date-type variables. Is this latter possible?
View Replies
View Related
Is it possible to call a stored procedure asynchronously from an ASP page?
We would like to be able to execute a proc and have the page continue to
process without having to wait for the proc to finish. I know you can make
a dll and call it from there, but we'd rather just be able to keep it simple
and call it from the page if we can.
View Replies
View Related
I am using SQL SERVER 2005 and ASP.
Would anyone be kind enough to give me a solution to the problem below please?
If for example in the stored procedure looks like this:
-- Initialize the SQL Server XML stored procedures
EXEC sp_xml_preparedocument @xmlDoc OUTPUT, @xmlString
Insert into @TableBook
SELECT * FROM OPENXML (@xmlDoc, 'books/book') WITH
(
bookNameVARCHAR(100) 'name',
authorVARCHAR(100) 'author'
)
The question is supposing there is a node called 'Surname' but I am not adding 'Surname' to 'Author'. If I want to check 'Surname' value DOES exists and I want to replace it with 'Author' or if 'Surname' does not exist, just use 'Author' node instead.
I am not sure how you can use IF statement to check a node and put the value into SET @surname and then put something like author VARCHAR(100) '@surname' OR author VARCHAR(100) '@Author'. Just like switching it around.
View Replies
View Related
I've got a problem with an ASP page which calls a stored proc. The sybase stored procedure returns numeric values as shown: ...
View Replies
View Related
I've created a Stored Procedure which adds a new record and updates some more records and then returns the primary key for the added record.
The SP seems to work OK, but I'm having problems getting at the returned key in my ASP code:
"Item cannot be found in the collection corresponding to the requested name or ordinal."
A common error, but in this case I can't see why... I output the SQL instruction that is sent to the DB and have run it in Query Analyser and it runs OK and returns a single row, with a single column - the new primary key...
But when I try and access this in ASP, I get the error message....
View Replies
View Related
I need to return XML from a SQL Stored Procedure which I will execute through ASP ADO code. Stored Procedure as below:
CREATE PROCEDURE pr_GetJobInfo2
@JobType int,
@CntryID int,
@JobTitle varchar(8000) OUTPUT
AS
SELECT @JobTitle = ltrim(rtrim(JobTitle))
FROM dbo.JOBS
WHERE JobType = @JobType
AND CntryID = @CntryID
FOR XML AUTO
[code]
Now the output parameter (@JobTitle) cannot be assigned to FOR XML, so what must I do ??? My ASP code reads as: ....
View Replies
View Related
Does anyone know how ASP calls a stored procedure in ORACLE ? I want the stored procedure to return a recordset bact to the ASP environment.
Can a stored procedure in ORACLE return a recordset to ASP. If so can you direct me to the necessary syntax that can be useful for this ?
View Replies
View Related
Is it possible to add a stored proc to a table adapter and execute the proc
inside an ASP button click event?
I have a table adapter called Claimers and a sp called AddWatch. On the
onclick event I would like to call the table adapter and execute the sp.
Note that the sp does not return records. Code:
View Replies
View Related
How can we get the <param> value for <object> in ASP
View Replies
View Related
In asp page how can I do this, can't seem to get it right
iInvNum = 123456
Response.Redirect "mypage.asp?invnum=iInvNum"
^ wrong here
View Replies
View Related
I need to redirect based on a param and here is what I am using:Code:
If Request("catid") = "9" Then Response.Redirect "ClassCatRealEstateSales.asp"
my guess is that there is a syntax problem, I am not getting an error because I have other lines that will catch blank ids and the like and redirect to a main page and that is working.
View Replies
View Related
I try to accomplish something like this:
<!--#include file="menu_<%response.write (strproduct)%>.html"-->
But unfortunally, I quess there is something with my syntax... any idea ?
View Replies
View Related
I have a form where a user can choose one or more options from drop-down menus to search the db :
service
town
county
The id's are all numbers in a MySql database. I have put the default param for each search as % and this only changes if the relevant search option is chosen: Code:
View Replies
View Related
Is there a way to 'force' a submit on a form with out actually allowing the
user to press a button ? For example...
step1: A from is filled out by a user, then they click the submit button.
step2: The form is 'post'ed to an ASP page which writes the values to a
database. So far No problems. But..
step3: Now I want to 'post' these values again to another page without any
user interaction.
My ideas were:
1) I know you can get the form values from Request.Form("myVar"), so I
thought of making a 'dummy' form and setting the 'values' of the form
variables to these Request.Form("myVar") valiables, but I don't know how to
'submit' them to another page again.
2) Is there some type of 'submit' command in ASP?
View Replies
View Related
i have a series of .asp pages that i am dividing into model, view, control logic. my view collects a whole bunch of data and posts it to the controller. im wondering if there is a way to somehow "re-post" this same data to my model page.
in short, is .asp capable of taking data posted to a page and re-post that same data to another page?
View Replies
View Related
I know that cookies are stored with a txt file in the client PC. but are cookies even stored in RAM? cuz i can access the cookie information but i cannot see the cookie a txt related to that in my PC...
View Replies
View Related
I am running the following code to an access database
' Recordset Object
Dim rs
' connecting to database
con.Open connStr
' executing stored procedure
Set rs = con.Execute ("exec SpotDesc")
' showing all records
While Not rs.EOF
Response.Write rs(0) & " " & rs(1) & "<br>"
rs.MoveNext
Wend
' closing connection and freeing resources
con.Close
Set rs = Nothing
This works and runs the stored procedure SpotDesc.
One question I have is that this line brings back the results
Response.Write rs(0) & " " & rs(1) & "<br>"
but requires me to know how many colums are being returned, ie rs(0) is column 1 and rs(1) is column 2
Is there a way of writing this line and it places all the columns there wheter it be 1, 2, or 3?
Ie a way of know how many columns are returned...
Is there also a way to show the column heading?
View Replies
View Related
Just a quick question. I am using Sql Server 2000 and calling stored procedures from asp.
At this stage i am forgoing using the ADO command object and am simply create dynamic like sql statement for store procedure execution.
My question is, I find the code below quite messy, particularly when it comes to checking for option parameters using if statements. Is their a better way to write this, keeping in mind i have to check in a value exists before adding the appropriate parameter
to the stored procedure call.
Is there are more elegant way?....
View Replies
View Related
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
A while back people were looking into stored procedures and code to list which ones exist
Does anyone know the code to list all the stored procedures in a my sql database?
View Replies
View Related
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
I have included in my database a location (web URL) of a file that the person using my site can click on and it will work as a normal hyperlink and go to that page.
In case that doesn't make sense,
Say this is my database:
IMEtitle
Sarah
LocationURL
http://this.com/here.html
I want to display on my page Sarah and Sarah be hyperlinked. The hyperlink is pulled from the database as well as Sarah.
Here is the code I have,
<a href = "<% =recordset("LocationURL") %>"> <%Response.Write recordset("IMEtitle")%></a>
Everything appears fine, but when I click the link it says just adds it to the end, it looks something like this:
http://www.nps.navy.mil/Content/DLR...S/Southwest.swf#
Whereas it should look like:
http://www.nps.edu/DL/DLRC/media_de...S/Southwest.swf
I have done this sort of thing in PHP, but I am not sure how to do it in ASP.
View Replies
View Related
there will be 4 files for 2 questions. Qn1.asp Q2.asp Check1.asp Check2.asp
Check1.asp consist of the codes below to check Q1.asp and Check2.asp is to check Q2.asp
What do i need to put in the "" in both check1.asp and check2.asp so that if the user answer both the qn correctly it will 2 out of 2.. both wrong 0 out of 2 and so on.. I want the points to be stored inside a database..
<%
r1=Trim(request.form("r1"))
r2=Trim(request.form("r2"))
r3=Trim(request.form("r3"))
I=Trim(request.form("I"))
urans=Trim(request.form("Answer1"))
result= Round(CLng(r3)*CLng(I)/(CLng(r2)+CLng(r3)))
if (CStr(result) = CStr(urans)) then
" "
elseif (CStr(result) <> CStr(urans)) then
" "
End if
%>
View Replies
View Related
could anyone provide me with some simple example code of asp classic
calling adodb? specifically, i'd like the code to:
- call a couple of stored procedures that have optional parameters
- share a connection over the two calls
View Replies
View Related
I am new to programming and I managed to store images in MSSQL.
The problem I have is that when I retrieve the image from the database
and display it in my browser it opens a new window. I would like to use
the image control, but it requires a url. Is there anyway of viewing that image
in the image control or keeping it in the same page where my information is
but displaying it where and when I want it
View Replies
View Related
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
If I have a html table with, lets say three columns, and I have to fill each column with different data from database, could I use a stored procedures to write three separate sql queries?All I need than is to create a loop for each column.
I have never tried before writing a code with more than one sql query, and that isn't working out for me this time. I've read about this stored procedures. I don't know if that's the answer.
View Replies
View Related