Post your SQL statements and I will put this into a Stored
Procedure for
you. This will give you far more flexibility and will run
more efficiently.
I may not be able to do it tonight though as I am about to go
out.
"Mark.P." <mark.pusateri@ey.com> wrote in message
news:f9fp2m$j5c$1@forums.macromedia.com...
>I do have that option but I don't know how to write them.
I don' t
>normally do
> this kind of thing but due to recent org changes i'm
learning on the fly.
> I
> was hoping this would be on the easy side. Guess not (at
least not for
> me).
> Here's where I'm at now with it, it's returning an error
at this point.
>
>
>
>
> <%
> If (CStr(Request("MM_insert")) = "addProject") Then
> If (Not MM_abortEdit) Then
>
> 'intNewKeyVal = rsProjects.Execute(MM_editCmd,
intRecordsAffected,
> adCmdText)(0)
> ' execute the insert
> Dim MM_editCmd
>
> Set MM_editCmd = Server.CreateObject ("ADODB.Command")
> MM_editCmd.ActiveConnection = MM_commStr_STRING
> MM_editCmd.CommandText = "INSERT INTO dbo.projects
(pName, pLead,
> status,
> startDate, endDate, audience, ojective, deliverables,
issues) VALUES (?,
> ?, ?,
> ?, ?, ?, ?, ?, ?) SELECT SCOPE_IDENTITY()"
> MM_editCmd.Prepared = true
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param1", 202,
> 1,
> 100, Request.Form("pName")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param2", 202,
> 1,
> 100, Request.Form("pLead")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param3", 202,
> 1,
> 50, Request.Form("status")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param4", 135,
> 1,
> -1, MM_IIF(Request.Form("startDate"),
Request.Form("startDate"), null)) '
> adDBTimeStamp
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param5", 135,
> 1,
> -1, MM_IIF(Request.Form("endDate"),
Request.Form("endDate"), null)) '
> adDBTimeStamp
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param6", 202,
> 1,
> 250, Request.Form("audience")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param7", 202,
> 1,
> 500, Request.Form("objective")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param8", 202,
> 1,
> 500, Request.Form("deliverables")) ' adVarWChar
> MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param9", 202,
> 1,
> 500, Request.Form("issues")) ' adVarWChar
> MM_editCmd.Execute
> intNewKeyVal = rsProjects.Execute(MM_editCmd,
intRecordsAffected,
> adCmdText)(0)
> MM_editCmd.ActiveConnection.Close
>
> ' append the query string to the redirect URL
> Dim MM_editRedirectUrl
> MM_editRedirectUrl = "insertPart2.asp?fKey=intNewKeyVal"
> If (Request.QueryString <> "") Then
> If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) =
0) Then
> MM_editRedirectUrl = MM_editRedirectUrl & "?" &
> Request.QueryString
> Else
> MM_editRedirectUrl = MM_editRedirectUrl & "&"
&
> Request.QueryString
> End If
> End If
> Response.Redirect(MM_editRedirectUrl)
> End If
> End If
> %>
>