Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2003, 01:07 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning E-Commerce with asp, vb..etc...

First time poster....

Running:
Windows XP
SQL Server 2000
Visual Studio 6.0

I am having issues with the detail.asp page to display product information. It shows the product, then it doesn't show it with all the details.

Here is the error...

 Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'atString'
/JoCoffee/detail.asp, line 74

But that variable is defined in the globals module....seems...I have tried what seems to be everything....

Could be a problem with the "datatype" and/or the database....i am at a loss on this one for now.....if anyone has any ideas, that would be cool...



Here is the code for the section that is a problem...

'get the attributes...
Dim Attributes
Set Attributes = Product.Attributes
If Not Attributes.EOF Then

'start a table...
Response.Write "<table cellspacing=0 cellpadding=0>"

'loop the attributes
Do While Not Attributes.EOF

'render the name
Response.Write "<tr><td class std>"
Response.Write Attributes("name") & ":&nbsp;"
Response.Write "</td><td class=std>"

'do we have a value set for this attribute and product?
If Not IsNull(Attributes("ProductID")) Then

'what data type do we have?
Select Case Attributes("Datatype")

case atString
Response.Write Attributes("StringValue")
case atLong
Response.Write Attributes("LongValue")
case atDouble
Response.Write _
FormatNumber(Attributes("DoubleValue"),2)
case atDate
Response.Write Attributes("DateValue")
case atBoolean
If Attributes("BooleanValue") = "True" Then
Response.Write "True"
Else
Response.Write "False"
End If
End Select
Else
Response.Write "?"
End If

'finish the row...
Response.Write "</td></tr>"

'next...
Attributes.MoveNext

Loop

'end table...
Response.Write "</table>"

End If
Attributes.Close
Set Attributes = Nothing


Thanks...


 
Old October 27th, 2003, 04:49 PM
Registered User
 
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to suvi65
Default

Hi

 It is not enough of having it in globals in VB. You need to have the following in site.asp

<%
   ' Globally define certain site metrics, such as its name and domain...

   ' globally define attribute datatypes...
    Const atInvalid = -1
    Const atString = 0
    Const atLong = 1
    Const atDouble = 2
    Const atDate = 3
    Const atBoolean = 4

  Insert this code at the beginning of site.asp. It will work fine

suvi65






Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP! Beginning E-commerce with VB.Net shevchenko All Other Wrox Books 0 March 9th, 2005 04:22 AM
Beginning ASP.NET E-Commerce using VB.NET KJ All Other Wrox Books 2 December 2nd, 2003 09:01 AM
VB permissions (Reynolds' "Beginning E-Commerce") muybn VB Components 0 July 16th, 2003 01:08 PM
Beginning ASP.NET E-commerce with VB.NET attipa All Other Wrox Books 2 June 23rd, 2003 10:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.