troubleshooting Question

Stored Procedure inserts Dreamweaver

Avatar of hbojorquezgeek
hbojorquezgeek asked on
Web Development
10 Comments1 Solution668 ViewsLast Modified:
I have been depending on Dreamweaver for WAAAY too many things..
And I've been learning MSSQL stored procedures (mostly for queries) and now I want to learn inserts using stored procedures (I have to do an identity retrieval...but I can't get past this!)

<% If Request("submit") <> "" Then %>

<%

Dim Command1__fname
Command1__fname = "1"
if(Request("fname") <> "") then Command1__fname = Request("fname")

Dim Command1__lname
Command1__lname = ""
if(Request("lname") <> "") then Command1__lname = Request("lname")

Dim Command1__email
Command1__email = ""
if(Request("email") <> "") then Command1__email = Request("email")

Dim Command1__date
Command1__date = ""
if(Request("date") <> "") then Command1__date = Request("date")

Dim Command1__contact
Command1__contact = ""
if(Request("contact") <> "") then Command1__contact = Request("contact")

Dim Command1__comments01
Command1__comments01 = ""
if(Request("comments01") <> "") then Command1__comments01 = Request("comments01")

Dim Command1__comments02
Command1__comments02 = ""
if(Request("comments02") <> "") then Command1__comments02 = Request("comments02")

Dim Command1__comments03
Command1__comments03 = ""
if(Request("comments03") <> "") then Command1__comments03 = Request("comments03")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_connFairfunding_STRING
Command1.CommandText = "dbo.spInsertRecord"
Command1.Parameters.Append Command1.CreateParameter("@fname", 200, 1,16,Command1__fname)
Command1.Parameters.Append Command1.CreateParameter("@lname", 200, 1,16,Command1__lname)
Command1.Parameters.Append Command1.CreateParameter("@email", 200, 1,16,Command1__email)
Command1.Parameters.Append Command1.CreateParameter("@date", 135, 1,16,Command1__date)
Command1.Parameters.Append Command1.CreateParameter("@contact", 129, 1,1,Command1__contact)
Command1.Parameters.Append Command1.CreateParameter("@comments01", 200, 1,16,Command1__comments01)
Command1.Parameters.Append Command1.CreateParameter("@comments02", 200, 1,16,Command1__comments02)
Command1.Parameters.Append Command1.CreateParameter("@comments03", 200, 1,16,Command1__comments03)
Command1.CommandType = 4
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<% End If %>


and heres my form...

<form name="form1">
 
   
        <input name="fname" type="text"   value="" size="32"> <br><br>
       
 
       <input type="text" name="lname" value="" size="32"> <br><br>
   
       <input type="text" name="email" value="" size="32"><br><br>
      <input type="text" name="contact" value="" size="32"><br><br>
      <textarea name="comments01" cols="50" rows="5"></textarea><br><br>
       <textarea name="comments02" cols="50" rows="5"></textarea><br><br>
      <textarea name="comments03" cols="50" rows="5"></textarea><br><br>
       <input type="text" name="pict" value="" size="32"><br><br>
    <input name="submit" type="submit" id="submit" value="Insert record">
</form>


How the heck does the insert actually happen...
I know that I will kick myself when I read the answer

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros