2 Replies - 3944 Views - Last Post: 21 August 2006 - 12:54 PM Rate Topic: -----

#1 absta  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 13-April 06

Recordset Error - Argument Type Mismatch

Posted 20 August 2006 - 07:33 AM

Hiya
I'm using
<%
Dim intCategoryID, myConn
intCategoryID = CInt(Request.QueryString("CategoryID"))
mySQL = "SELECT lngProductID, strTitle, curPrice, intCategoryID " &_
"FROM tblCategories INNER JOIN tblProducts " &_
"ON tblCategories.intCategoryID = tblProducts.intCategoryID " &_
"WHERE tblProducts.intCategoryID = " & intCategoryID & " " &_
"ORDER BY strTitle"
Set myRS = Server.CreateObject("ADODB.Recordset")
myRS.Open myConn (line 19)
Response.Write "<p>The products in the category of <b>" &_
  myRS("strCategory") & "</b> are:"
While Not myRS.EOF
  Response.Write "<p><b><a href='products.asp?ProductID=" &_
  myRS("lngProductID") & "&CartID=" & CartID & "'>" & myRS("strTitle") & "</a></b><br>"
If myRS("lngSizeID") <> "" Then
  Response.Write myRS("lngSizeID") & "<br>"
End If
  Response.Write "<b>Price:</b> $" & FormatNumber(myRS("curPrice"),2) & "</p>"
  myRS.MoveNext
Wend
myRS.Close
Set myRS = Nothing
%>


this at present but its coming up with ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another - line 19 is the problem. Advice please
thanks in advance

This post has been edited by absta: 20 August 2006 - 07:34 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Recordset Error - Argument Type Mismatch

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Recordset Error - Argument Type Mismatch

Posted 20 August 2006 - 08:00 AM

While you have declared the variable myConn, you have not instatiated it - it holds no value, unless there is more code that has not been provided.
Was This Post Helpful? 0
  • +
  • -

#3 absta  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 58
  • Joined: 13-April 06

Re: Recordset Error - Argument Type Mismatch

Posted 21 August 2006 - 12:54 PM

well managed to suss it out to display my products in the category of ...... albeit a basic layout
<%
Dim intCategoryID
Set myRS = Server.CreateObject("ADODB.Recordset")
intCategoryID = CInt(Request.QueryString("CategoryID"))
mySQL = "SELECT * FROM tblCategories INNER JOIN tblProducts ON tblCategories.intCategoryID = tblProducts.intCategoryID WHERE tblCategories.intCategoryID=" & intCategoryID & ";"
myRS.Open mySQL, objConn, adOpenDynamic, adLockOptimistic, adCmdText
If myRS.EOF Then
Response.Write "No records found"
Else
Response.Write "<p>The products in the category of " &_
  myRS("strCategory") & " are:"
End If
While Not myRS.EOF
  Response.Write "<p><b><a href='products.asp?ProductID=" &_
  myRS("lngProductID") & "&CartID=" & CartID & "'>" & myRS("strTitle") & "</a></b><br>"
If myRS("memDescription") <> "" Then
  Response.Write myRS("memDescription") & "<br>"
End If
  Response.Write "<b>Price:</b> " & FormatNumber(myRS("curPrice"),2) & "</p>"
  myRS.MoveNext
Wend
myRS.Close
Set myRS = Nothing
%>

thought i should let you know, all working good, thanks for your input Amadeus
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1