need asp shopping cart
I need a simple shopping cart in a hurry.
I downloaded a script:
ASP 101 Sample Code - http://www.asp101.com
It looks really smart. But I am having trouble installing it onto my site which uses a ms access 2000 database for product information.
Can anybody reccommend a really easy well commented asp shopping cart script that I will be able to install easily and will work for sure?
Andy Kohlenberg
Jerusalem, Israel
Wil posted this at 10:47 — 1st May 2002.
They have: 601 posts
Joined: Nov 2001
You say you're having trouble installing a cart that uses a database? Am I meant to read this as you do not have access to a database? Or not?
The only place I would advise you to look at is hotscripts.com :
http://www.hotscripts.com/ASP/Scripts_and_Components/E-Commerce/Shopping_Carts/
- wil
akohl posted this at 11:04 — 1st May 2002.
They have: 117 posts
Joined: Feb 2001
I have a database connection which works. Its just that when I use values from a recordset for the parameters, I get errors.
Are you familiar with that particular script?
Should I post the specifics of my problem and try to get it to work?
Its a free script. Can you tell me if its worth my time or should I look for another one?
Andy Kohlenberg
Jerusalem, Israel
Wil posted this at 11:21 — 1st May 2002.
They have: 601 posts
Joined: Nov 2001
Hi
No, sorry, I don't have knoweldge of ASP or using MS based databases. However, there are a few folks around that do - I'll move your message to the database forum to see if someone can help you get this working!
Good luck!
- wil
Peter J. Boettcher posted this at 12:56 — 1st May 2002.
They have: 812 posts
Joined: Feb 2000
That code should work with Access, maybe post the specific error you're getting along with the line of code that is genereating the error.
akohl posted this at 14:54 — 1st May 2002.
They have: 117 posts
Joined: Feb 2001
So here I am again with some code that doesn't seem to work. Thanks for offering to help.
Error Type:
ADODB.Field (0x80020009)
Object is no longer valid.
/akohl/m-pomeranz/asp/client/shopping.asp
I just made changes in one function. So I've posted the function. I assume you have the rest of the code on hand.
Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price
' However we need to keep price so it can be converted to a
' single for computation hence no currency symbol. This array
' can also be expanded to contain any other information about the
' product that you might want to pull from the DB.
call connection
dim rs1,sqlStr
dim i,j
'dim arBookData,firstRecord,lastRecord,firstField,lastField
'this querry gets all the book data in database.
'could add a clause limiting it to items which are featured.
sqlStr="SELECT issue_details.issue_details_id, issue_details.binding, issue_details.price, books.title"
sqlStr=sqlStr&" FROM books INNER JOIN issue_details ON books.book_id = issue_details.book_id"
sqlStr=sqlStr&" WHERE (((issue_details.issue_details_id)="&iItemID&"));"
Set rs1=Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = con1
rs1.Source = sqlStr
rs1.CursorLocation = 3 '3=adUseClient
rs1.CursorType = 3 '1= adOpenForwardOnly
rs1.Locktype = 1 '1=adLockReadOnly
rs1.Open
Set rs1.ActiveConnection = Nothing
'***************************orignal code replaced with the line below it
' Select Case iItemID
' Case 1
' aParameters = Array("./images/shop_shirt.gif", "ASP 101 T-Shirt", "15.00")
' Case 2
' aParameters = Array("./images/shop_kite.gif", "ASP 101 Kite", "17.50")
' Case 3
' aParameters = Array("./images/shop_watch.gif", "ASP 101 Watch", "35.00")
' Case 4 ' Not in use because we couldn't draw a pen in a few seconds!
' aParameters = Array("./images/shop_pen.gif", "ASP 101 Pen", "5.00")
' End Select
'***************************
aParameters = Array("./images/shop_watch.gif", rs1.fields("title"), "35.00")
' Return array containing product info.
rs1.close
set rs1=nothing
closeConnection()
GetItemParameters = aParameters
End Function
%>
Andy Kohlenberg
Jerusalem, Israel
Peter J. Boettcher posted this at 20:18 — 1st May 2002.
They have: 812 posts
Joined: Feb 2000
No error line number?
Looks like you're trying to access a recordset or command object that is closed.
Try adding a .Value to rs1.fields("title"), the code might think you're refering to it (reference) instead of just the value.
PJ | Are we there yet?
pjboettcher.com
akohl posted this at 00:19 — 2nd May 2002.
They have: 117 posts
Joined: Feb 2001
Nope. No error line number.
The recordset object is fine. I tested that by just printing
the value of rs1.fields("title") instead of assigning it to an array which is taken further in the code. And besides, when you make errors with a recordset object, that's not the kind of error message you get. I have a lot of experience with those aggravating error messages.
My guess is that the problem has to do with some other object, perhaps the library object, or session and some issue with the the way the code handles the value from recrodset. Perhaps I'm not giving it the right variable type.
I'm not sure I really understood your suggestion. Could you explain further. And what about the direction I'm thinking in. Am I barking up the right tree?
Andy Kohlenberg
Jerusalem, Israel
Peter J. Boettcher posted this at 12:50 — 2nd May 2002.
They have: 812 posts
Joined: Feb 2000
I don't think its the session or library object, otherwise it wouldn't be an ADODB.Field error.
What I meant is, the code might think you're actually referencing the field as an object instead of a value, so by adding the .Value you would be sure you're passing it as a value and not as an object.
PJ | Are we there yet?
pjboettcher.com
akohl posted this at 09:36 — 3rd May 2002.
They have: 117 posts
Joined: Feb 2001
Now I understand what you mean. I'll try that.
Thanks
akohl posted this at 13:52 — 3rd May 2002.
They have: 117 posts
Joined: Feb 2001
That worked!
Thanks a million.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.