Abort Edit Issue

M

Mangler

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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top