Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Help! I can't get this UPDATE stored procedure to work...

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-07 : 08:44:42
Will writes "I get this error

-->
ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/ccd/ccd_edit_exe.asp, line 92

When I try to update my SQL table with data from an ASP page.

Line 92 is

-->
cmd.CommandType = adCmdStoredProc


Here is the stored procedure "sp_EditContactRecord":

Alter Procedure sp_EditContactRecord
(
@contactID INT,
@firstname VARCHAR(50),
@lastname VARCHAR(50),
@title VARCHAR(100),
@organizationname VARCHAR(100),
@streetaddress VARCHAR(200),
@city VARCHAR(100),
@state VARCHAR(30),
@zipcode VARCHAR(20),
@country VARCHAR(100),
@homephone VARCHAR(50),
@workphone VARCHAR(50),
@mobilephone VARCHAR(50),
@otherphone1 VARCHAR(50),
@otherphone2 VARCHAR(50),
@email VARCHAR(100),
@category1 VARCHAR(50),
@category2 VARCHAR(50),
@category3 VARCHAR(50),
@category4 VARCHAR(50),
@category5 VARCHAR(50),
@keywords VARCHAR(200),
@talkrating INT,
@DateCreated DATETIME,
@author VARCHAR(50)
)
As

UPDATE ContactMain

SET
firstname = @firstname,
lastname = @lastname,
title = @title,
organizationname = @organizationname,
streetaddress = @streetaddress,
city = @city,
state = @state,
zipcode = @zipcode,
country = @country,
homephone = @homephone,
workphone = @workphone,
mobilephone = @mobilephone,
otherphone1 = @otherphone1,
otherphone2 = @otherphone2,
email = @email,
category1 = @category1,
category2 = @category2,
category3 = @category3,
category4 = @category4,
category5 = @category5,
keywords = @keywords,
talkrating = @talkrating,
DateCreated =@datecreated,
author = @author


WHERE contactID = @contactID



And here is the asp code im using :

contactID = Request.Form("contactID")
firstname = Request.Form("firstname")
lastname = Request.Form("lastname")
title = Request.Form("title")
organizationname = Request.Form("organizationname")
streetaddress = Request.Form("streetaddress")
city = Request.Form("city")
state = Request.Form("state")
zipcode = Request.Form("zipcode")

If Request.Form("country") = "none selected" then
country = ""
Else
country = Request.Form("country")
End If

homephone = Request.Form("homephone")
workphone = Request.Form("workphone")
mobilephone = Request.Form("mobilephone")
otherphone1 = Request.Form("otherphone1")
otherphone2 = Request.Form("otherphone2")
email = Request.Form("email")

If Request.Form("category1") = "none" then
category1 = ""
Else
category1 = Request.Form("category1")
End If

If Request.Form("category2") = "none" then
category2 = ""
Else
category2 = Request.Form("category2")
End If

If Request.Form("category3") = "none" then
category3 = ""
Else
category3 = Request.Form("category3")
End If

If Request.Form("category4") = "none" then
category4 = ""
Else
category4 = Request.Form("category4")
End If

If Request.Form("category5") = "none" then
category5 = ""
Else
category5 = Request.Form("category5")
End If

keywords = Request.Form("keywords")
talkrating = Request.Form("talkrating")
DateCreated = formatDateTime(Now, 2)
author = Session("validlogin")

'open connection
sConnString = "DSN=*****"
Set db = Server.CreateObject("ADODB.Connection")
db.Open sConnString, "*****", "*****"

Set cmd = Server.CreateObject("ADODB.Command")
cmd.CommandText = "sp_EditContactRecord"
cmd.ActiveConnection = db
cmd.CommandType = adCmdStoredProc


' add the data if all is well.
cmd.Parameters.Append cmd.CreateParameter("firstname", adVarChar, adParamInput, 50, firstname)
cmd.Parameters.Append
   

- Advertisement -