Help, again!

Results 1 to 3 of 3

Thread: Help, again!

  1. #1
    Join Date
    Dec 1969

    Default Help, again!

    The following code gives me the first recordset, but then it says that there is an error (Type mismatch: &#039aParameters&#039). Is there a way to grab the database values and put them into the array?<BR>===<BR>Function GetItemParameters(iItemID)<BR>set conn = server.createobject("adodb.connection")<BR>set rs = server.createobject("adodb.recordset")<BR>conn.ope n "bubba"<BR>SQLSTMT = "SELECT * FROM Item"<BR>set rs = conn.execute(SQLstmt)<BR> identification = rs("ItemID")<BR> small_image = rs("sm_image")<BR> itemname = rs("ItemName")<BR> itemprice = rs("Price")<BR><BR>while not rs.eof<BR> if iItemID = identification then<BR> aParameters = Array( small_image , itemname , itemprice )<BR> end if<BR> rs.MoveNext<BR>wend<BR><BR>GetItemParameters = aParameters<BR>End Function<BR>===<BR>HELP!

  2. #2
    John M. Guest

    Default RE: Help, again!

    My guess is that one of the columns in the table Item is NULLABLE. If one of the items in your result set is NULL, you cannot put this item into an array.

  3. #3
    Join Date
    Dec 1969

    Default RE: Help, again!

    Try this:<BR><BR>Function GetItemParameters(iItemID)<BR><BR>set conn = server.createobject("adodb.connection")<BR>set rs = server.createobject("adodb.recordset")<BR>SQLSTMT = "SELECT * FROM Item"<BR><BR> "bubba"<BR>set rs = conn.execute(SQLstmt)<BR><BR>do until rs.eof<BR> if iItemID = rs("ItemID") then<BR> aParameters = Array( rs("small_image") , rs("ItemName") , rs("Price") )<BR> end if<BR> rs.MoveNext<BR>loop<BR><BR>GetItemParameters = aParameters<BR><BR>End Function<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts