PDA

View Full Version : Recordset problems


lithriel
07-13-2007, 09:43 PM
I am using Dreamweaver. I am using a connection string and VB Script.

I have the following error on my client-modify page:

ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/acme/admin/client-modify.asp, line 37

Line 37 is "rsClients_cmd.ActiveConnection = MM_conAcme_STRING"

Here is the VB code:

<<A href="mailto:%@LANGUAGE="VBSCRIPT">%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="2,3"
MM_authFailedURL="../denied.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim rsClients__MMColParam
rsClients__MMColParam = "1"
If (Request.QueryString("clientID") <> "") Then
rsClients__MMColParam = Request.QueryString("clientID")
End If
%>
<%
Dim rsClients
Dim rsClients_cmd
Dim rsClients_numRows
Set rsClients_cmd = Server.CreateObject ("ADODB.Command")
rsClients_cmd.ActiveConnection = MM_conAcme_STRING **************This is the line it says the error is on
rsClients_cmd.CommandText = "SELECT * FROM lithriel.clients WHERE clientID = ?"
rsClients_cmd.Prepared = true
rsClients_cmd.Parameters.Append rsClients_cmd.CreateParameter("param1", 5, 1, -1, rsClients__MMColParam)


Set rsClients = rsClients_cmd.Execute
rsClients_numRows = 0
%>
<!--#include file="../../Connections/conAcme.asp" -->
<!--#include file="../adovbs.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_update")) = "client") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_conAcme_STRING
MM_editCmd.CommandText = "UPDATE lithriel.clients SET fName = ?, lName = ?, dayPhone = ?, nightPhone = ?, userName = ?, password = ?, password = ?, secQtn = ?, secAns = ?, bAddress = ?, bCity = ?, bState = ?, bZip = ?, sAddress = ?, sCity = ?, sState = ?, sZip = ? WHERE clientID = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 15, Request.Form("fname")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, 25, Request.Form("lname")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 201, 1, 10, Request.Form("dayPhone")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 201, 1, 10, Request.Form("nightPhone")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 201, 1, 30, Request.Form("email")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 201, 1, 15, Request.Form("password1")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 201, 1, 15, Request.Form("password2")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 201, 1, 250, Request.Form("secQtn")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 201, 1, 250, Request.Form("secAns")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param10", 201, 1, 40, Request.Form("bAddress")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param11", 201, 1, 20, Request.Form("bCity")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param12", 201, 1, 2, Request.Form("bState")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param13", 201, 1, 10, Request.Form("bZip")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param14", 201, 1, 40, Request.Form("sAddress")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param15", 201, 1, 20, Request.Form("sCity")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param16", 201, 1, 2, Request.Form("sState")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param17", 201, 1, 10, Request.Form("sZip")) ' adLongVarChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "client.asp"
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
%>

davidj
07-13-2007, 09:45 PM
i could be wrong here but we dont have any ASP people

lithriel
07-13-2007, 10:26 PM
Part of the problem was that my connections include file wasn't on the second line but in the middle of the code. Anyone else who has this problem should try this.

Now I get a new error saying that there isn't a current record. Hm...

lithriel
07-13-2007, 10:26 PM
Thanks anyway