Forums
This topic is locked
ASP Update Command Variables in Dreamweaver 8.0.2
28 Sep 2007 07:37:09 Ken Ryan posted:
I am not using the right Type and Value for the P_ID field. Here are the particulars:Using SQL 2000
P_ID is int value of 4 (using "Integer" for type and "4" for the value.
I am getting the error:
ADODB.Command error '800a0d5d'
Application uses a value of the wrong type for the current operation.
/admin/pages/pageEditing.asp, line 20
Here is the code
<pre id=code><font face=courier size=2 id=code><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/Connections/connSite.asp" -->
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
Set cmdSavePage = Server.CreateObject ("ADODB.Command"
cmdSavePage.ActiveConnection = MM_connSite_STRING
cmdSavePage.CommandText = "UPDATE dbo.tblPages SET P_NAME = ? , Message = ? WHERE P_ID = ? "
cmdSavePage.Parameters.Append cmdSavePage.CreateParameter("varName", 202, 1, 100, MM_IIF(Request.Form("P_NAME", Request.Form("P_NAME", cmdSavePage__varName & "")
cmdSavePage.Parameters.Append cmdSavePage.CreateParameter("varMessage", 203, 1, 1073741823, MM_IIF(Request.Form("message", Request.Form("message", cmdSavePage__varMessage & "")
cmdSavePage.Parameters.Append cmdSavePage.CreateParameter("varID", 3, 1, 4, MM_IIF(Request.Form("P_ID", Request.Form("P_ID", cmdSavePage__varID & "")
cmdSavePage.CommandType = 1
cmdSavePage.CommandTimeout = 0
cmdSavePage.Prepared = true
cmdSavePage.Execute()
%>
<!--#include virtual="/mailing_list/common.asp" -->
<%
'Reset Server Variables
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood" = False or IsNull(Session("blnIsUserGood") = True then
'Redirect to unathorised user page
Response.Redirect"/admin/unauthorised_user_page.htm"
End If
%>
<%
Response.Redirect("/admin/pages/default.asp"
%>
</font id=code></pre id=code>
What am I doing wrong? I have searched and searched. The paper that Adobe put out is only for inserting a record and it is not updating. In that instance the database is handling all of the ID's for you. Please help! FAST!!!!
Thanks,
Ken Ryan
Edited by - kryan on 28 Sep 2007 07:38:47
Edited by - kryan on 28 Sep 2007 07:39:56