For Programmers: Free Programming Magazines  


Home > Archive > ASP > January 2007 > Abort Edit Issue









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Abort Edit Issue
Mangler

2007-01-10, 6:56 pm

I have a SQL stored proc that returns a result of yes if the a record
exsists. In turn there is a command that calls the proc and passes
variables when a user inserts data. If the result is yes the insert
is aborted ( well supposed to be ) I cant seem to get the abort part
working.

Command


<%


set spDup = Server.CreateObject("ADODB.Command")
spDup.ActiveConnection = MM_connReclaim_STRING
spDup.CommandText = "dbo.dup"
spDup.CommandType = 4
spDup.CommandTimeout = 0
spDup.Prepared = true
spDup.Parameters.Append spDup.CreateParameter("@RETURN_VALUE", 3, 4,3)
spDup.Parameters.Append spDup.CreateParameter("@rma", 200,
1,15,spDup__rma)
spDup.Parameters.Append spDup.CreateParameter("@model", 200,
1,15,spDup__model)
spDup.Parameters.Append spDup.CreateParameter("@part", 200,
1,15,spDup__part)
spDup.Parameters.Append spDup.CreateParameter("@qty", 200,
1,15,spDup__qty)
spDup.Parameters.Append spDup.CreateParameter("@result", 200, 2,15)
spDup.Execute()
spDupresult = spDup("@result")
%>


If that returns "YES" than abort the insert....


Dim MM_tableValues
Dim MM_dbValues


If (CStr(Request("MM_insert")) <> "") Then


If spDupresult = "YES" Then
MM_abortEdit = true


End If


' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)


Can someone help??

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com