If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-02, 18:45
arif arif is offline
Registered User
 
Join Date: Oct 2002
Posts: 4
ASP Error

Hello,

I am recieving the following error message:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/im250/addCart.asp, line 76


Now this is line 76:

SET RS = Con.Execute( sqlString )

With lines 68-75 as follows:

<%
' Get the shopping cart
sqlString = "SELECT cart_id, product_name, " &_
"product_price, cart_quantity " &_
"FROM cart, products " &_
"WHERE cart_userID=" & userID & " " &_
"AND cart_productID = product_id " &_
"ORDER BY cart_id DESC"

I am new to ASP and have been stuck on this error for quite awhile now. It is using a MSAccess database also. Do I have to change the code or is it something to do with my connection? I would be very grateful for any help or ideas!

Thank You.

Arif.
Reply With Quote
  #2 (permalink)  
Old 10-22-02, 00:59
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Sorry, I did not see this post until today, so you may have already found the mistake.

You did not separate the product_id out of the string.

"WHERE cart_userID=" & userID & " " &_
"AND cart_productID =" & product_id & " " &_
"ORDER BY cart_id DESC"

Let me know if you need help.
Reply With Quote
  #3 (permalink)  
Old 10-23-02, 16:50
arif arif is offline
Registered User
 
Join Date: Oct 2002
Posts: 4
After i separated product_id out of the string, i am now getting the following error message:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'cart_userID=1 AND cart_productID='.
/im250/addCart.asp, line 76

Now cart_userID is an autonumber field and therefore is ciorrect at '1'. Whereas cart_productID is a number field which should contain the product_id of the product contained in the cart.

I have 'played' around with the code but still receive error messages because i think it is to do with the syntax of the code, right!? Could anyone please help me?

Many thanks
Reply With Quote
  #4 (permalink)  
Old 10-23-02, 17:25
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Your product_id variable is hosed - do a response.write with the product_id with some text around it and see if a value exists. The error is leading me to believe that product_id is empty (or hosed).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On