Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with setting up a shopping cart.

Status
Not open for further replies.

havoc33

Technical User
Dec 3, 2003
16
NO
I'm building a website with a shopping cart. But when I'm setting up the cartID, I get a error message. My browser is in norwegian, but I think the msg says "Type mismatch" (or something like that). Here is the code:

dim CartID
CartID = Request.QueryString ("CartID")

If CartID = "" Then
Dim randomnum, datenum
randomize
randomnum = int((999999-100000+1) * rnd + 100000)
datenum = replace(date,"/","")
CartID = randomnum & datenum
'Tester her om CartID er tom. Hvis det er tilfelle vil brukeren få en ny CartID.

Dim myRScart
Set myRScart = Server.CreateObject ("ADODB.Recordset")
myRScart.Open "Carts", myConn, 1, 3
myRScart.AddNew
myRScart("CartID") = CartID 'Here is where I get the error message!!
myRScart("CreatedD") = Date
myRScart("CreatedT") = Time
myRScart.Update
myRScart.Close
End If
 
What is the type of the CartID column in the table Carts ?
If numeric, try something like this:
myRScart("CartID") = CDbl(CartID)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No, the data type is float. Any suggestions?
 
Have you even tried my suggestion ?
1) float is numeric
2) CDbl is the float conversion routine

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Yeah, I tried it. It still doesn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top