Subject: Beginning E-Commerce with asp, vb..etc...
Posted By: drummer Post Date: 8/18/2003 1:07:37 AM
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...


Reply By: suvi65 Reply Date: 10/27/2003 3:49:04 PM
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


Go to topic 3254

Return to index page 1018
Return to index page 1017
Return to index page 1016
Return to index page 1015
Return to index page 1014
Return to index page 1013
Return to index page 1012
Return to index page 1011
Return to index page 1010
Return to index page 1009