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