troubleshooting Question

.Command Issue?

Avatar of kevp75
kevp75Flag for United States of America asked on
27 Comments7 Solutions436 ViewsLast Modified:
Can I pick a brain for a bit?

I am trying to make a sub-routine for using ado.command, and I have hit a wall.

Sub execute_query(connection, querytext, parameters)
      Dim cmd, i, rs
      Set cmd = Server.CreateObject("ADODB.Command")
      cmd.CommandText = querytext
      cmd.CommandType = 1
      For i = 0 To UBound(parameters)
            cmd.Parameters.Append(cmd.CreateParameter(, 132, 0, len(parameters(i)), parameters(i)))    '<---Line 9
      Set cmd.ActiveConnection = connection
      Set rs = cmd.Execute()
      Set execute_query = rs
End Sub

dim strQry : strQry = "UPDATE TMPTable SET tmpField1 = ?, tmpField2 = ?, tmpField3 = ?, tmpField4 = ?, tmpField5 = ? WHERE tmpID = ?"
Call execute_query(inrsConn, strQry, Array("Email", "", 1, "10/10/2007", 1, 1))


I keep getting:
ADODB.Command error '800a0bb9'

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

/myfolder/myfile.asp, line 9
Carl Tawn
Senior Systems and Integration Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 7 Answers and 27 Comments.
Start Free Trial
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 7 Answers and 27 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