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
ADVERTISEMENT
How do I write the code for a button that will call a function/procedure in ASP and delete all records in an array? Should I use a function or procedure? Anyone who would like to finish this code? Code:
View Replies
View Related
I'm looking for sample code that will require a use to enter a code from a scued image format.
I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.
I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.
View Replies
View Related
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
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
how to write store procedure in asp?
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
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'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
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
View Related
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
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
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
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
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
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
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
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
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
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 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
I have a query that selects from multiple tables and is complicated, thus making the number of code lines very big. I'd like to separate it from the page that displays the query results.
I have been told that a stored procedure will do the trick, but I've just come across another option, 'include file'. I'm used to programming in ColdFusion so I am familiar with the concept of including files.
View Replies
View Related
when i try to write a procedure in asp file i get error message, Please explain whats wrong in my coding?
<%
CREATE PROCEDURE ProcedureName_1 AS
select * from table1
%>
Error message:-
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/sixsigma/installation_region.asp, line 2
CREATE PROCEDURE ProcedureName_1 AS
View Replies
View Related
I'm trying to access a stored procedure in oracle using asp/jscript.
I get an error message complaining about the parameters;
[Oracle][ODBC][Ora]ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'UPDATE_BAKERY_USER' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
A Response.write returns this:
CommandText: { call BUNGE.UPDATE_BAKERY_USER(?, ?, ?) }
The stored procedure changes a users password, so the parameters are:
plogin
pold_password
pnew_password
Can anyone please help me verify my code?
Code:....
View Replies
View Related
I am new to asp, basically new to everything. but I am trying to create a log table and and trouble calling my stored procedure from my asp page, see code:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'sp_logsession'
/app/lib.asp, line 71
i am using the following code to execute it in my asp page:
SET objConn = Server.CreateObject("ADODB.Connection")
objConn.Open Application("deConn")
Execute sp_logsession(browser,timenow,remoteaddress,idsess ion,refer)
is there anyone who could help me to get this working?
View Replies
View Related
I have a stored procedure in SQL Server 2000 named sp_FolioM with this code:
-----------
CREATE PROCEDURE sp_FolioM (@FolioTraspaso int OUTPUT)
AS
DECLARE @Existe int
SELECT @FolioTraspaso = ValorEntero FROM Parametros
WHERE Clave = 'NUMMOV'
UPDATE Parametros SET ValorEntero = ValorEntero + 1
WHERE CLAVE = 'NUMMOV'
GO
--------
Now, when i run the Query of Select ValorEntero FROM Parametros WHERE Clave = 'NUMMOV'
it returns a column with 4 rows (values)
......
In Asp i have the following code to capture the output value and i think it only writes the last value ( row #4, last one )
Values:
108106
108106
38149
38149
ASP CODE:
--------
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include virtual="/../../ADOVBS.INC"-->
<HTML>
<HEAD><TITLE>Place Document Title Here</TITLE></HEAD>
<BODY>
<%
Dim objConn, objCmd, objParam
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "driver={SQL Server};server=APALACIOS;uid=sa;pwd=;database=PDigital"
Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.CommandText = "sp_FolioM"
objCmd.CommandType = adCmdStoredProc
objcmd.ActiveConnection = objConn
Set objParam = objCmd.CreateParameter ("@FolioTraspaso",adInteger,adParamOutput,4)
objCmd.Parameters.Append objParam
ObjCmd.Execute
%>
Valor: <%=objCmd.Parameters("@FolioTraspaso")%><br>
</BODY>
</HTML>
i only see Valor: 38149
what if i want to write the first value ( row number 1 )?
View Replies
View Related
I would like to know if anyone knows how to execute a stored procedure from ASP.NET 2.0. I'm using the NorthWind database and I'm trying to execute the "CustOrderHist" stored procedure. The error I get is "Incorrect syntax near 'CustOrderHist'. "
Public Function GetCustomerOrderHistory(ByVal customerid As String) As
SqlDataReader
Dim conn As New SqlConnection(conString)
Dim cmd As New SqlCommand("CustOrderHist", conn)
cmd.Parameters.AddWithValue("@CustomerID", customerid)
conn.Open()
Dim dtr As SqlDataReader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)
Return dtr
End Function
View Replies
View Related
I am having a problem running an sql stored procedure with ADO/ASP. If I hard code a select statement, the code works, but when I try to use a stored procedure it bombs. Here is my code:
THIS WORKS:
sql="SELECT PartNumber FROM Scrap WHERE DateOpened BETWEEN '20030601', '20030605'"
'Note: I already did my connection object above
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn
THIS DOES NOT:
'my stored procedure is LC_Top50_ByCost sql="LC_Top50_ByCost 'DB', '20030601', '20030605'"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn
HERE IS THE ERROR:
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
/MyWeb/T10_Cost.asp, line 202
Line 202 is the first line that I try to access the data in the
recordset.
View Replies
View Related
How do I call a Stored Procedure with ASP?
View Replies
View Related
I'm new to asp but not new to web programming. I've been a cold fusion developer for a few years now, but due to a job changes I've had to learn asp. I'm running into a problem calling my stored procedure. The procedure runs fine in Query Analyer so I know that works, but when I try to call it using asp I get:
ADODB.Commanderror '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/ce/etracker/aIssue.asp, line 7
Here is my code.....
View Replies
View Related
I'm not sure if you can do this but what I want to do it execute a stored procedure but query it with dynamic ASP data. Basically,
exex StoredProc where id = 2
I am using a set of dynamic data and I truly belive looping trought the dataset would be too much overhead on the server.
View Replies
View Related
I keep getting an error from the following SP snippet
"Line 11: Incorrect syntax near 'BY'."
It runs fine without the ORDER BY clause.
[color=blue][color=green][color=darkred]
>>>>>>>>>>>>>>>[/color][/color][/color]
[' + @user + ']
WHERE
[' + @cal + '].clientID = [' + @user1 + '].userID
AND [' + @cal + '].newID = ' + @userID + ' ORDER BY [' + @cal +
'].myAppointment'
EXEC (@sql)
GO[color=blue][color=green][color=darkred]
>>>>>>>>>>>>>>>[/color][/color][/color]
Any suggestions?
View Replies
View Related
I am using a simple stored procedure that just searches for the cities whos name starts with the keyword enterd. But the below code dosnt seems to work. any ideas.
I am using SQL Server 2000
Code:
CREATE PROCEDURE va_search_location
@keyword varchar(50)
AS
Select * from tblcities where CityName like '@keyword%'
GO
View Replies
View Related