UKTamo
02-19-2007, 08:20 AM
Hi
I'm getting the following error:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/basket_util.asp, line 56.
basket_util.asp is shown below and the error line is shown.
<%
'## This page is setup to process the shopper's basket content.
'## It contains all the utility Subroutines and Functions.
'This Sub routine adds a product to shopper's basket
Function FcnAddtoBasket (ConnObj,usr_GUID,prodID,prodname,prodquantity,prodlistprice,prodsaleprice)
dim strAddCode,rsAdd
set rsAdd = server.CreateObject ("ADODB.RECORDSET")
rsAdd.Open "EXEC sproc_addToBasket " & chr(39) & usr_GUID & chr(39) & "," & chr(39) & prodID & chr(39) & "," & chr(39) & prodname & chr(39) & "," & prodquantity & "," & prodlistprice & "," & prodsaleprice,ConnObj
strAddCode = rsAdd("errorcode")
FcnAddtoBasket = strAddCode
rsAdd.Close
set rsAdd = nothing
End Function
'This sub routine deletes the shopper's entire basket content
Function FcnDeleteBasket(ConnObj,usr_GUID,bID)
Dim rsDel
set rsDel = server.CreateObject ("ADODB.recordset")
rsDel.Open "EXEC sproc_deleteBasket " & chr(39) & usr_GUID & chr(39) & "," & bID,ConnObj
FcnDeleteBasket = rsDel("errorcode")
rsDel.Close
Set rsDel = nothing
End Function
'This sub routine deletes the shopper's entire basket content
Function FcnMakeDefBasket(ConnObj,usr_GUID,bID)
Dim rsDef
set rsDef = server.CreateObject ("ADODB.recordset")
rsDef.Open "EXEC sproc_makeDefaultBasket " & chr(39) & usr_GUID & chr(39) & "," & bID,ConnObj
FcnMakeDefBasket = rsDef("errorcode")
rsDef.Close
Set rsDef = nothing
End Function
'this sub updates the shopper's basket
Sub SubUpdateBasket(updStr)
dim updConn
set updConn = server.CreateObject ("ADODB.Connection")
updConn.ConnectionString = strBasketDSN
updConn.Open
updConn.Execute updStr
updConn.Close
Set updConn = nothing
End Sub
'This function gets shopper's basket and returns the recordset to caller
Function FcnGetBasket (ConnObj,usr_GUID)
Dim rsTemp
set rsTemp = server.CreateObject ("ADODB.recordset")
ERROR Line: rsTemp.Open "EXEC sproc_getBasket " & chr(39) & usr_GUID & chr(39),ConnObj 'error line
Set FcnGetBasket = rsTemp
End Function
'This function saves the shopper's current basket
Function FcnSaveBasket (ConnObj,usr_GUID,bName,bID)
Dim rsSave
set rsSave = server.CreateObject ("ADODB.recordset")
rsSave.Open "EXEC sproc_saveBasket " & chr(39) & usr_GUID & chr(39) & "," & chr(39) & bName & chr(39) & "," & bID,ConnObj
FcnSaveBasket = rsSave("errorcode")
rsSave.Close
Set rsSave = nothing
End Function
'This function gets shopper's previously saved baskets, if any
Function FcnGetSavedBaskets (ConnObj,usr_GUID)
Dim rsTempSaved
set rsTempSaved = server.CreateObject ("ADODB.recordset")
rsTempSaved.Open "EXEC sproc_getSavedBaskets " & chr(39) & usr_GUID & chr(39),ConnObj
Set FcnGetSavedBaskets = rsTempSaved
Set rsTempSaved = nothing
End Function
'This sub writes out a generic error message
Sub writeError
Response.Write ("<font color='red'><p>An error occured while processing your basket request!<br>Please contact the site Administrator.<p></font>")
End Sub
'This sub writes out a message for saved baskets
Sub writeSavedBasketMessage
Response.Write ("<h4>Your Saved Baskets</h4><p><font color='brown'>You do not have any saved basket at this time.</font><p>")
End Sub
'This sub writes out a message for attempted duplicate entries
Sub writeDuplicateEntryMessage
Response.Write "<font color='green'>You already have this product in your basket.</font>"
End Sub
'This function returns a 32 character GUID from SQL Server
Function FcnGenerateGUID(ConnObj)
dim strGUID,rsGUID
set rsGUID = server.CreateObject ("ADODB.RECORDSET")
rsGUID.Open "EXEC sproc_createGUID",ConnObj
strGUID = rsGUID("guid")
FcnGenerateGUID = strGUID
rsGUID.Close
set rsGUID = nothing
End Function
'==============================================================
'This subroutine reads the DSN, and open's a
'connection object for the basket page
Sub SubGetDSNCreateConn
strBasketDSN = Application("strBaskDSN")
set BaskConn = server.CreateObject ("ADODB.Connection")
'BaskConn.ConnectionString = "travcart"
BaskConn = "provider=sqloledb;data source=(local);initial catalog=cart;user id=sa;password=password@1;"
BaskConn.Open
End Sub
'This subroutine gets a 32 char guid from SQL and
'writes that value to the shopper's cookie as their shopper ID
Sub SubCreateNReturnGUID
Dim myGuid
'Call function to return a GUID
myGuid = FcnGenerateGUID(BaskConn)
'append created userGuid to cookie...
Response.Cookies ("shopGuid")("Guid") = myGuid
Response.Cookies ("shopGuid").expires = "August 30, 2020"
End Sub
%>
<% Sub BasketHeader 'To display Basket Header %>
<table cellspacing="1" cellpadding="1" border="0" width="500">
<tr bgcolor="gray">
<th><b> <font size="-1" color="#ffffff">Item</font></b></th>
<th><b> <font size="-1" color="#ffffff">Item ID</font></b></th>
<th><b> <font size="-1" color="#ffffff">Qty</font></b></th>
<th><b> <font size="-1" color="#ffffff">Unit<br>Price</font></b></th>
<th><b> <font size="-1" color="#ffffff">Sale<br>Price</font></b></th>
<th><b> <font size="-1" color="#ffffff">Total</font></b></th>
</tr>
<% End Sub %>
<% Sub BasketManager 'To Manage Saved Baskets %>
<P>
<h4>Your Saved Baskets</h4>
<form name="BaskMgr" method="POST" action="basket.asp">
<table cellspacing="2" cellpadding="1" border="0" width="500">
<th align="left" bgcolor="gray"><b> <font size="-1" color="#ffffff">Basket Name</font></b></th>
<th align="left" bgcolor="gray"><b> <font size="-1" color="#ffffff">Date Created</font></b></th>
<th> </th>
<th> </th>
<!-- Loop to populate table -->
<% do
Dim strBName,strDateCreated,intSavedBaskID
intSavedBaskID = rsSavedBaskets("basket_id")
strBName = rsSavedBaskets("basket_name")
strDateCreated = rsSavedBaskets("date_created")
%>
<tr>
<td><%= strBName %></td>
<td><%= strDateCreated %></td>
<td align="center"><a href="basket.asp?btnMkDef=<%= intSavedBaskID %>"><b>Make Default</b></a></td>
<td align="center"><a href="basket.asp?btnDelSaved=<%= intSavedBaskID %>"><b>Delete</b></a></td>
</tr>
<%
rsSavedBaskets.movenext
loop until rsSavedBaskets.eof
rsSavedBaskets.close
set rsSavedBaskets = nothing
%>
<!-- End Loop -->
</table>
</form>
<% End Sub %>
Any help would be appreciated as I'm totally new to ASP and SQL.
Thanks
I'm getting the following error:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/basket_util.asp, line 56.
basket_util.asp is shown below and the error line is shown.
<%
'## This page is setup to process the shopper's basket content.
'## It contains all the utility Subroutines and Functions.
'This Sub routine adds a product to shopper's basket
Function FcnAddtoBasket (ConnObj,usr_GUID,prodID,prodname,prodquantity,prodlistprice,prodsaleprice)
dim strAddCode,rsAdd
set rsAdd = server.CreateObject ("ADODB.RECORDSET")
rsAdd.Open "EXEC sproc_addToBasket " & chr(39) & usr_GUID & chr(39) & "," & chr(39) & prodID & chr(39) & "," & chr(39) & prodname & chr(39) & "," & prodquantity & "," & prodlistprice & "," & prodsaleprice,ConnObj
strAddCode = rsAdd("errorcode")
FcnAddtoBasket = strAddCode
rsAdd.Close
set rsAdd = nothing
End Function
'This sub routine deletes the shopper's entire basket content
Function FcnDeleteBasket(ConnObj,usr_GUID,bID)
Dim rsDel
set rsDel = server.CreateObject ("ADODB.recordset")
rsDel.Open "EXEC sproc_deleteBasket " & chr(39) & usr_GUID & chr(39) & "," & bID,ConnObj
FcnDeleteBasket = rsDel("errorcode")
rsDel.Close
Set rsDel = nothing
End Function
'This sub routine deletes the shopper's entire basket content
Function FcnMakeDefBasket(ConnObj,usr_GUID,bID)
Dim rsDef
set rsDef = server.CreateObject ("ADODB.recordset")
rsDef.Open "EXEC sproc_makeDefaultBasket " & chr(39) & usr_GUID & chr(39) & "," & bID,ConnObj
FcnMakeDefBasket = rsDef("errorcode")
rsDef.Close
Set rsDef = nothing
End Function
'this sub updates the shopper's basket
Sub SubUpdateBasket(updStr)
dim updConn
set updConn = server.CreateObject ("ADODB.Connection")
updConn.ConnectionString = strBasketDSN
updConn.Open
updConn.Execute updStr
updConn.Close
Set updConn = nothing
End Sub
'This function gets shopper's basket and returns the recordset to caller
Function FcnGetBasket (ConnObj,usr_GUID)
Dim rsTemp
set rsTemp = server.CreateObject ("ADODB.recordset")
ERROR Line: rsTemp.Open "EXEC sproc_getBasket " & chr(39) & usr_GUID & chr(39),ConnObj 'error line
Set FcnGetBasket = rsTemp
End Function
'This function saves the shopper's current basket
Function FcnSaveBasket (ConnObj,usr_GUID,bName,bID)
Dim rsSave
set rsSave = server.CreateObject ("ADODB.recordset")
rsSave.Open "EXEC sproc_saveBasket " & chr(39) & usr_GUID & chr(39) & "," & chr(39) & bName & chr(39) & "," & bID,ConnObj
FcnSaveBasket = rsSave("errorcode")
rsSave.Close
Set rsSave = nothing
End Function
'This function gets shopper's previously saved baskets, if any
Function FcnGetSavedBaskets (ConnObj,usr_GUID)
Dim rsTempSaved
set rsTempSaved = server.CreateObject ("ADODB.recordset")
rsTempSaved.Open "EXEC sproc_getSavedBaskets " & chr(39) & usr_GUID & chr(39),ConnObj
Set FcnGetSavedBaskets = rsTempSaved
Set rsTempSaved = nothing
End Function
'This sub writes out a generic error message
Sub writeError
Response.Write ("<font color='red'><p>An error occured while processing your basket request!<br>Please contact the site Administrator.<p></font>")
End Sub
'This sub writes out a message for saved baskets
Sub writeSavedBasketMessage
Response.Write ("<h4>Your Saved Baskets</h4><p><font color='brown'>You do not have any saved basket at this time.</font><p>")
End Sub
'This sub writes out a message for attempted duplicate entries
Sub writeDuplicateEntryMessage
Response.Write "<font color='green'>You already have this product in your basket.</font>"
End Sub
'This function returns a 32 character GUID from SQL Server
Function FcnGenerateGUID(ConnObj)
dim strGUID,rsGUID
set rsGUID = server.CreateObject ("ADODB.RECORDSET")
rsGUID.Open "EXEC sproc_createGUID",ConnObj
strGUID = rsGUID("guid")
FcnGenerateGUID = strGUID
rsGUID.Close
set rsGUID = nothing
End Function
'==============================================================
'This subroutine reads the DSN, and open's a
'connection object for the basket page
Sub SubGetDSNCreateConn
strBasketDSN = Application("strBaskDSN")
set BaskConn = server.CreateObject ("ADODB.Connection")
'BaskConn.ConnectionString = "travcart"
BaskConn = "provider=sqloledb;data source=(local);initial catalog=cart;user id=sa;password=password@1;"
BaskConn.Open
End Sub
'This subroutine gets a 32 char guid from SQL and
'writes that value to the shopper's cookie as their shopper ID
Sub SubCreateNReturnGUID
Dim myGuid
'Call function to return a GUID
myGuid = FcnGenerateGUID(BaskConn)
'append created userGuid to cookie...
Response.Cookies ("shopGuid")("Guid") = myGuid
Response.Cookies ("shopGuid").expires = "August 30, 2020"
End Sub
%>
<% Sub BasketHeader 'To display Basket Header %>
<table cellspacing="1" cellpadding="1" border="0" width="500">
<tr bgcolor="gray">
<th><b> <font size="-1" color="#ffffff">Item</font></b></th>
<th><b> <font size="-1" color="#ffffff">Item ID</font></b></th>
<th><b> <font size="-1" color="#ffffff">Qty</font></b></th>
<th><b> <font size="-1" color="#ffffff">Unit<br>Price</font></b></th>
<th><b> <font size="-1" color="#ffffff">Sale<br>Price</font></b></th>
<th><b> <font size="-1" color="#ffffff">Total</font></b></th>
</tr>
<% End Sub %>
<% Sub BasketManager 'To Manage Saved Baskets %>
<P>
<h4>Your Saved Baskets</h4>
<form name="BaskMgr" method="POST" action="basket.asp">
<table cellspacing="2" cellpadding="1" border="0" width="500">
<th align="left" bgcolor="gray"><b> <font size="-1" color="#ffffff">Basket Name</font></b></th>
<th align="left" bgcolor="gray"><b> <font size="-1" color="#ffffff">Date Created</font></b></th>
<th> </th>
<th> </th>
<!-- Loop to populate table -->
<% do
Dim strBName,strDateCreated,intSavedBaskID
intSavedBaskID = rsSavedBaskets("basket_id")
strBName = rsSavedBaskets("basket_name")
strDateCreated = rsSavedBaskets("date_created")
%>
<tr>
<td><%= strBName %></td>
<td><%= strDateCreated %></td>
<td align="center"><a href="basket.asp?btnMkDef=<%= intSavedBaskID %>"><b>Make Default</b></a></td>
<td align="center"><a href="basket.asp?btnDelSaved=<%= intSavedBaskID %>"><b>Delete</b></a></td>
</tr>
<%
rsSavedBaskets.movenext
loop until rsSavedBaskets.eof
rsSavedBaskets.close
set rsSavedBaskets = nothing
%>
<!-- End Loop -->
</table>
</form>
<% End Sub %>
Any help would be appreciated as I'm totally new to ASP and SQL.
Thanks