Solved

ASP & Components problem

Posted on 2001-07-08
18
288 Views
Last Modified: 2007-12-19
Hello there.  I?m trying to run some .asp examples from a book called ?Instant ASP components? (ISBN: 0-07-212552-7). The problem is that I keep receiving the following error message:

Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp.
/good_book/Web Site/html/index.asp, line 4

Below I include the file that corresponds to the above error message. The problem is that I have to create the HFM component first? And do I need necessarily MS Visual Basic to do so?



<%
Option Explicit
Dim MyHFM
Set MyHFM = Server.CreateObject("HFM.HFMData")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="Microsoft FrontPage 4.0">
<% Response.Write MyHFM.GetKeywordTag("Home") %>
<% Response.Write MyHFM.GetDescriptionTag("Home") %>
<% Response.Write MyHFM.GetTitleTag("Home") %>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080" TEXT="#000000" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
    <FORM NAME="LAYOUTFORM" ACTION="./html/job_board_listings.asp" METHOD=POST>
        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=615>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD WIDTH=15 HEIGHT=15><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
                <TD></TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD HEIGHT=24></TD>
                <TD WIDTH=600><IMG ID="Banner2" HEIGHT=24 WIDTH=600 SRC="./assets/images/autogen/Home_Page_NTabBanner.gif" BORDER=0 ALT="Home Page"></TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD COLSPAN=2 HEIGHT=21></TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD></TD>
                <TD WIDTH=600  BGCOLOR="#CCFFFF">
                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=600>
                        <TR>
                            <TD><P><B><FONT SIZE="+1" FACE="Arial,Helvetica,Univers,Zurich BT">Welcome to our site!</FONT></B></TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD COLSPAN=2 HEIGHT=29></TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD></TD>
                <TD WIDTH=600><P>The text of the page would go here.</TD>
            </TR>
        </TABLE>
        <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=330>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD>
                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=165>
                        <TR VALIGN=TOP ALIGN=LEFT>
                            <TD WIDTH=15 HEIGHT=41><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
                            <TD WIDTH=150><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=150 HEIGHT=1 BORDER=0></TD>
                        </TR>
                        <TR VALIGN=TOP ALIGN=LEFT>
                            <TD></TD>
                            <TD WIDTH=150  BGCOLOR="#CCFFFF">
                                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=150>
                                    <TR>
                                        <TD><P ALIGN=CENTER><A HREF="./html/about_us.asp"><B><FONT SIZE="+1" FACE="Arial,Helvetica,Univers,Zurich BT">About Us</FONT></B></A></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
                <TD>
                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=165>
                        <TR VALIGN=TOP ALIGN=LEFT>
                            <TD WIDTH=15 HEIGHT=41><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
                            <TD WIDTH=150><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=150 HEIGHT=1 BORDER=0></TD>
                        </TR>
                        <TR VALIGN=TOP ALIGN=LEFT>
                            <TD></TD>
                            <TD WIDTH=150  BGCOLOR="#CCFFFF">
                                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=150>
                                    <TR>
                                        <TD><P ALIGN=CENTER><A HREF="./html/contact_info.asp"><B><FONT SIZE="+1" FACE="Arial,Helvetica,Univers,Zurich BT">Contact Info</FONT></B></A></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=615>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD WIDTH=15 HEIGHT=29><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
                <TD WIDTH=600><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=600 HEIGHT=1 BORDER=0></TD>
            </TR>
            <TR VALIGN=TOP ALIGN=LEFT>
                <TD></TD>
                <TD WIDTH=600><% Response.Write MyHFM.GetSpecialData("Footer") %></TD>
            </TR>
        </TABLE>
    </FORM>
</BODY>
</HTML>
0
Comment
Question by:chrispkotsiopoulos
  • 8
  • 6
  • 3
  • +1
18 Comments
 

Expert Comment

by:shlomof
ID: 6262297
It looks like you have to regirtare a component/dll/ocx or on your computer.  I am not familiar with this book or product but the object HFM requires registration. Look in the instructions.  It is usually done like this:

regsvr32 c:\xxx\htm.dll

c:\xxx it the full path of the object.  htm.dll is the object.  as i mentioned it could be something else like ocx, etc.
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6262327
And what excactly I have to do to register HFM object?
0
 

Expert Comment

by:shlomof
ID: 6262338
first of all you have to copy it to your pc.  once you have it there and know its pysical directory, then you can register it.
0
 
LVL 9

Expert Comment

by:TTom
ID: 6262564
I have the book (at work) so I can take a look at it tomorrow.  However, I believe you do need Visual Basic in order to create the components mentioned in it.  That's the whole point of using components in ASP.  You create compiled components using VB and then you use them in your ASP pages.

The comments above indicate what you will need to do once your component is created.

Tom
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6262918
In order to run the example of the above book I need a .dll file, something like HFM.dll. In the book source code I found three files that seems to be relevant:
HFMdata.cls
HFM.vbw
HFM.vbp
Below I give you the content of each file. What on earth do I have to do to create the .dll file and run the above example as well as the rest of the examples of the book?


****HFMdata.cls****
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "HFMData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit


Public Function GetTitleTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select PageTitle from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetTitleTag = "<TITLE>" & RSPageInfo("PageTitle") _
        & "</TITLE>"
End Function

Public Function GetKeywordTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select MetaKeyword from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetKeywordTag = "<meta name=""keywords"" content=""" _
        & RSPageInfo("MetaKeyword") & """>"
End Function

Public Function GetDescriptionTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select MetaDescription from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetDescriptionTag = "<meta name=""description"" content=""" _
        & RSPageInfo("MetaDescription") & """>"
End Function



Public Function GetSpecialData(SpecialDataName)
    Dim Conn As New ADODB.Connection
    Dim RSSpecialData As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSSpecialData = Conn.Execute("Select SpecialDataValue from " _
        & "C13SpecialData where " _
        & "SpecialDataName= '" & SpecialDataName & "'")
    If RSSpecialData.EOF Then
        Err.Raise vbObjectError + 2, "HeaderFooterMeta Server", _
            "SpecialDataName was not found."
    End If
    GetSpecialData = RSSpecialData("SpecialDataValue")
End Function


*****HFM.vbp*****
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINDOWS\SYSTEM\STDOLE2.TLB#OLE Automation
Reference=*\G{00000200-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\..\..\..\PROGRAM FILES\COMMON FILES\SYSTEM\ADO\msado20.tlb#Microsoft ActiveX Data Objects 2.0 Library
Class=HFMData; HFMData.cls
Startup="(None)"
HelpFile=""
ExeName32="HFM.dll"
Path32="..\..\..\..\..\..\windows\system"
Command32=""
Name="HFM"
HelpContextID="0"
CompatibleMode="1"
CompatibleEXE32="..\..\..\..\..\..\windows\system\HFM.dll"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="me"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
ThreadingModel=1

****HFM.vbw****
HFMData = 26, 120, 668, 466,
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6262925
The HFMdata.cls is apparently a file that contain VB source code. I would appreciate some comments about HFM.vbw and HFM.vbp files because I really don't understand their use...
0
 

Expert Comment

by:shlomof
ID: 6262970
When you create a VB project, it creates those two files where the .vbp is the source code.
0
 
LVL 15

Expert Comment

by:robbert
ID: 6263084
Have you already tried double-clicking HFM.vbp?
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6264276
Apparently the problem is that I don?t have the Visual Basic installed. When I install it how exactly I have to use the above files to generate the .dll?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:shlomof
ID: 6264620
After you have this dll registered on your PC, the above code that you sent will recornize the object HFM.  Therefore, line 4 in your code will generate an instance HFM.HFMData and should work.

Good luck
0
 
LVL 9

Expert Comment

by:TTom
ID: 6264902
Once you install VB on your machine, you will need to create a project (for an ActiveX.dll), insert the code from the book, and compile the project.  I believe this will register the .dll on your machine, and you will then be able to reference it in your ASP pages.

If you want to move the .dll to another server, you will need to copy the .dll file (no need for the other files) to the target server and then register the .dll (using regsrv32.exe).

Tom
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6268545
I have inserted the code from HFMdata.cls file into my .dll project but it doesn't compile. There seems to be a problem with the first line of the code. I receive the following error message:

Compile error:
Expected: end of statement
0
 

Expert Comment

by:shlomof
ID: 6269007
Need to see the code.
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6272349
Some comments above I give the HFM.vbp opened with Notepad. Below I give the same file opened with VB. I manage to make a .dll file using the file below but I still receive error messages:

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'GetKeywordTag'

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC Microsoft Access Driver] Not a valid account name or password.
/asp_comp_new!!!!!/Web Site/html/index.asp, line 11


***HFM.vbp***

Option Explicit


Public Function GetTitleTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select PageTitle from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetTitleTag = "<TITLE>" & RSPageInfo("PageTitle") _
        & "</TITLE>"
End Function

Public Function GetKeywordTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select MetaKeyword from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetKeywordTag = "<meta name=""keywords"" content=""" _
        & RSPageInfo("MetaKeyword") & """>"
End Function

Public Function GetDescriptionTag(PageName)
    Dim Conn As New ADODB.Connection
    Dim RSPageInfo As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSPageInfo = Conn.Execute("Select MetaDescription from " _
        & "C13HM where PageName = '" & PageName & "'")
    If RSPageInfo.EOF Then
        Err.Raise vbObjectError + 1, "HeaderFooterMeta Server", _
            "PageName was not found."
    End If
    GetDescriptionTag = "<meta name=""description"" content=""" _
        & RSPageInfo("MetaDescription") & """>"
End Function



Public Function GetSpecialData(SpecialDataName)
    Dim Conn As New ADODB.Connection
    Dim RSSpecialData As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSSpecialData = Conn.Execute("Select SpecialDataValue from " _
        & "C13SpecialData where " _
        & "SpecialDataName= '" & SpecialDataName & "'")
    If RSSpecialData.EOF Then
        Err.Raise vbObjectError + 2, "HeaderFooterMeta Server", _
            "SpecialDataName was not found."
    End If
    GetSpecialData = RSSpecialData("SpecialDataValue")
End Function
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6274313
In this comment I include a more complete example. So ignore the previous comments.
Although I have compiled and register the .dll file
succesfully I keep receiving the error message below. The database I use is Access 2000. I already use ADO in my component so I don't think that it is a database connectivity problem. My guess is that the .asp file doesn't see the .dll file.


Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'RecordHit'
/lucky_tery/WebSite/index.asp, line 5


Below I give you the following files

* index.asp
* OnlineStore.vbp opened with VB and notepad
* OnlineStoreProcs.cls opened with VB and notepad
* OnlineStore.vbw



****index.asp****
<%
Option Explicit
Dim MyOnlineStore
Set MyOnlineStore = Server.CreateObject("OnlineStore.OnlineStoreProcs")
MyOnlineStore.RecordHit Session, "Home"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="NetObjects Fusion 4.0.1 for Windows">
<TITLE>Bulk Foods Online</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080" TEXT="#000000" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=615>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD WIDTH=15 HEIGHT=15><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
            <TD></TD>
        </TR>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD HEIGHT=25></TD>
            <TD WIDTH=600><IMG ID="Banner2" HEIGHT=25 WIDTH=600 SRC="./assets/images/autogen/Bulk_Foods_Online_NElementalBanner.GIF" BORDER=0 ALT="Bulk Foods Online"></TD>
        </TR>
    </TABLE>
    <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=615>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD>
                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=210>
                    <TR VALIGN=TOP ALIGN=LEFT>
                        <TD WIDTH=15><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
                        <TD WIDTH=195  BGCOLOR="#FFFFCC" BACKGROUND="./assets/images/58.jpg">
                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=195>
                                <TR>
                                    <TD><P ALIGN=CENTER><A HREF="./html/catalog_menu.asp"><B><FONT SIZE="-1" FACE="Arial,Helvetica,Univers,Zurich BT">Online Catalog</FONT></B></A></TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                </TABLE>
            </TD>
            <TD>
                <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=405>
                    <TR VALIGN=TOP ALIGN=LEFT>
                        <TD>
                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=210>
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD WIDTH=210  BGCOLOR="#FFFFCC" BACKGROUND="./assets/images/am.jpg">
                                        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=210>
                                            <TR>
                                                <TD><P ALIGN=CENTER><A HREF="./html/shopping_cart.asp"><B><FONT SIZE="-1" FACE="Arial,Helvetica,Univers,Zurich BT">Shopping Cart</FONT></B></A></TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                        <TD>
                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=195>
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD WIDTH=195  BGCOLOR="#FFFFCC" BACKGROUND="./assets/images/back.jpg">
                                        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=195>
                                            <TR>
                                                <TD><P ALIGN=CENTER><A HREF="./html/support.asp"><B><FONT SIZE="-1" FACE="Arial,Helvetica,Univers,Zurich BT">Support</FONT></B></A></TD>
                                            </TR>
                                        </TABLE>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
    </TABLE>
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=615>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD WIDTH=15><IMG SRC="./assets/images/autogen/clearpixel.gif" WIDTH=15 HEIGHT=1 BORDER=0></TD>
            <TD WIDTH=600  BGCOLOR="#000000">
                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=600>
                    <TR>
                        <TD><P ALIGN=CENTER><B><FONT COLOR="#FFFFFF" SIZE="+1" FACE="Arial,Helvetica,Univers,Zurich BT">Welcome to the Bulk Foods Online Store</FONT></B></TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD COLSPAN=2 HEIGHT=8></TD>
        </TR>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD></TD>
            <TD WIDTH=600><P><FONT FACE="Arial,Helvetica,Univers,Zurich BT">Thanks for taking the time to visit our store. We offer the freshest Bulk Foods at ridiculously low prices. <P>Click on the Online Catalog link above to start shopping.
                You can also view wish lists by going to that page.<P>To see what items you have placed in your shopping cart and to check out, click on the Shopping Cart link.<P>Did you save an order last time you shopped with us? You'll find
                that order at the Shopping Cart also.<P>Do you have questions about us or our products? Click on the Support link for 24 hour LIVE support.</FONT></TD>
        </TR>
    </TABLE>
</BODY>
</HTML>





****OnlineStore.vbp****(opened with VB)
Option Explicit

Public Sub RecordHit(TheSession As ASPTypeLibrary.Session, _
    PageName)
    Dim Conn As New ADODB.Connection
    Dim RSVisitorID As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    If IsEmpty(TheSession("VisitorID")) Then
        Conn.Execute "Insert Into C20Visitors (" _
            & "DateTimeEntered) Values (" _
            & "'" & Now & "')"
        Set RSVisitorID = Conn.Execute("Select Max(VisitorID) " _
            & "as MaxID from C20Visitors")
        TheSession("VisitorID") = RSVisitorID("MaxID")
    End If
    Conn.Execute "Insert Into C20PageViews (VisitorID, " _
        & "WhenVisited, PageName) Values (" _
        & TheSession("VisitorID") & ", " _
        & "'" & Now & "', '" _
        & PageName & "')"
End Sub

Public Function CategoryList()
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName from " _
        & "C20Categories Order By CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<OPTION VALUE=""" _
            & RSCategories("CategoryName") & """>" _
            & RSCategories("CategoryName") & "</OPTION>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    CategoryList = TempReturn
End Function

Public Function SubCategories(ParentCategory, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "ParentCategory = '" & ParentCategory & "' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategories = TempReturn
End Function

Public Function SubCategoriesInSearch(SearchText, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "CategoryName Like '*" & SearchText & "*' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategoriesInSearch = TempReturn
End Function

Public Function ProductsInCategory(CategoryName, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where CategoryName = '" _
        & CategoryName & "' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInCategory = TempReturn
End Function

Public Function ProductsInSearch(SearchText, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where BriefDescription Like '*" _
        & SearchText & "*' or ProductName Like '*" & SearchText _
        & "*' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInSearch = TempReturn
End Function

Public Function GetProductName(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductName from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductName = RSProduct("ProductName")
End Function

Public Function GetProductPrice(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductPrice from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductPrice = RSProduct("Productprice")
End Function

Public Function GetProductBrief(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select BriefDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductBrief = RSProduct("BriefDescription")
End Function

Public Function GetProductLong(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select LongDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
   End If
    GetProductLong = RSProduct("LongDescription")
End Function

Public Function GetIconPath(ProductID)
Dim Conn As New ADODB.Connection
Dim RSProduct As ADODB.Recordset
If Not IsNumeric(ProductID) Then
Err.Raise vbObjectError + 1, "OnlineStore Server", _
"ProductID must be numeric."
End If
Conn.Open "ASPComp", "sa", ""
Set RSProduct = Conn.Execute("Select Path2Icon from " _
& "C20Products where ProductID = " & ProductID)
If RSProduct.EOF Then
Err.Raise vbObjectError + 2, "OnlineStore Server", _
"ProductID was not found."
End If
GetIconPath = RSProduct("Path2Icon")
End Function

Public Function GetPicturePath(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select Path2Picture from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetPicturePath = RSProduct("Path2Picture")
End Function

Public Sub AddToWishList(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20WishListItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Function GetWishList(VisitorID, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    If Not IsNumeric(VisitorID) Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "VisitorID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select C20Products.ProductName, " _
        & "C20Products.ProductID, C20Products.ProductPrice " _
        & "From C20Products INNER JOIN C20WishListItems ON " _
        & "C20Products.ProductID = C20WishListItems.ProductID " _
        & "Where C20WishListItems.VisitorID = " & VisitorID _
        & " Order By C20Products.ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    GetWishList = TempReturn
End Function

Public Sub AddToShoppingCart(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20OrderItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Sub RemoveFromShoppingCart(OrderItemID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(OrderItemID) Then
        Err.Raise vbObjectError + 4, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Delete From C20OrderItems " _
        & "Where OrderItemID = " & OrderItemID
End Sub

Public Function ShowShoppingCart(TheSession As ASPTypeLibrary.Session, _
    ProductPage, RemovePage)
    Dim Conn As New ADODB.Connection
    Dim RSOrderItems As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSOrderItems = Conn.Execute("Select C20Products.ProductID, " _
        & "C20Products.ProductName, C20Products.ProductPrice, " _
        & "C20Products.ShippingPrice, C20OrderItems.OrderItemID " _
        & "From C20Products INNER JOIN C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where C20OrderItems.VisitorID = " & TheSession("VisitorID"))
    TempReturn = "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 WIDTH=600>" _
        & vbNewLine & "<TR>" & vbNewLine & "<TD><P><B>Product Name</B></TD>" _
        & vbNewLine & "<TD><P><B>Price</B></TD>" _
        & vbNewLine & "<TD><P><B>Shipping</B></TD>" _
        & vbNewLine & "<TD><P><B>Remove from Cart</B></TD>" _
        & vbNewLine & "</TR>" & vbNewLine
    Do Until RSOrderItems.EOF
        TempReturn = TempReturn & "<TR>" & vbNewLine _
            & "<TD><P><A HREF=""" & ProductPage & "?ProductID=" _
            & RSOrderItems("ProductID") & """>" _
            & RSOrderItems("ProductName") & "</A></TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ProductPrice")) _
            & "</TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ShippingPrice")) _
            & "</TD>" & vbNewLine & "<TD><P><A HREF=""" _
            & RemovePage & "?OrderItemID=" & RSOrderItems("OrderItemID") _
            & """>Remove</A></TD>" & vbNewLine & "</TR>" & vbNewLine
        RSOrderItems.MoveNext
    Loop
    TempReturn = TempReturn & "</TABLE>"
    ShowShoppingCart = TempReturn
End Function

Public Function GetOrderTotal(TheSession As ASPTypeLibrary.Session)
    Dim Conn As New ADODB.Connection
    Dim RSTotal As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSTotal = Conn.Execute("SELECT SUM(ProductPrice + ShippingPrice) " _
        & "AS TheSum FROM C20Products INNER JOIN " _
        & "C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where VisitorID = " & TheSession("VisitorID"))
    GetOrderTotal = RSTotal("TheSum")
End Function

Public Function CheckOut(TheSession As ASPTypeLibrary.Session, _
    TheRequest As ASPTypeLibrary.Request)
    Dim Conn As New ADODB.Connection
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Update C20Visitors set " _
        & "YourName = '" & TheRequest.Form("YourName") & "', " _
        & "Email = '" & TheRequest.Form("Email") & "', " _
        & "Address = '" & TheRequest.Form("Address") & "', " _
        & "CSZ = '" & TheRequest.Form("CSZ") & "', " _
        & "PhoneNumber = '" & TheRequest.Form("PhoneNumber") & "', " _
        & "CreditCardType = '" & TheRequest.Form("CreditCardType") & "', " _
        & "CreditCardNumber = '" & TheRequest.Form("CreditCardNumber") & "', " _
        & "ExpirationDate = '" & TheRequest.Form("ExpirationDate") & "', " _
        & "OrderTotal = " & GetOrderTotal(TheSession) & ", " _
        & "Status = 'OrderPlaced' " _
        & "Where VisitorID = " & TheSession("VisitorID")
    TempReturn = TheSession("VisitorID")
    TheSession.Abandon
    CheckOut = TempReturn
End Function

Public Function FAQList()
Dim Conn As New ADODB.Connection
Dim RSQuestions As ADODB.Recordset
Dim TempReturn As String
Conn.Open "ASPComp", "sa", ""
Set RSQuestions = Conn.Execute("Select FaqID, Question " _
& "From C20FAQ")
Do Until RSQuestions.EOF
TempReturn = TempReturn & "<OPTION VALUE=""" _
& RSQuestions("FAQID") & """>" _
& RSQuestions("Question") & "</OPTION>" _
& vbNewLine
RSQuestions.MoveNext
Loop

FAQList = TempReturn
End Function

Public Function GetFAQAnswer(FAQID)
    Dim Conn As New ADODB.Connection
    Dim RSFAQ As ADODB.Recordset
    If Not IsNumeric(FAQID) Then
        Err.Raise vbObjectError + 5, "OnlineStore Server", _
            "FAQID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSFAQ = Conn.Execute("Select Answer from C20FAQ " _
        & "Where FaqID = " & FAQID)
    If RSFAQ.EOF Then
        Err.Raise vbObjectError + 6, "OnlineStore Server", _
            "FAQID was not found."
    End If
    GetFAQAnswer = RSFAQ("Answer")
End Function

Public Sub AddVisitorQuestion(TheName, TheEmail, TheQuestion)
    Dim Conn As New ADODB.Connection
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20VisitorQuestions (VisitorsName, " _
        & "VisitorsEmail, QuestionText) Values (" _
        & "'" & TheName & "', " _
        & "'" & TheEmail & "', " _
        & "'" & TheQuestion & "')"
End Sub




****OnlineStore.vbp****(opened with notepad)
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\WINNT\System32\stdole2.tlb#OLE Automation
Reference=*\G{D97A6DA0-A85C-11CF-83AE-00A0C90C2BD8}#2.0#0#..\..\..\..\Program Files\Microsoft Visual Studio\Common\IDE\IDE98\ASP.TLB#Microsoft Active Server Pages Object Library
Reference=*\G{00000200-0000-0010-8000-00AA006D2EA4}#2.0#0#..\..\..\..\Program Files\Common Files\system\ado\msado20.tlb#Microsoft ActiveX Data Objects 2.0 Library
Class=OnlineStoreProcs; OnlineStoreProcs.cls
Startup="(None)"
HelpFile=""
ExeName32="OnlineStore.dll"
Path32="..\..\..\..\WINNT\system"
Command32=""
Name="OnlineStore"
HelpContextID="0"
CompatibleMode="0"
CompatibleEXE32="..\..\..\..\WINNT\system\OnlineStore.dll"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="me"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
ThreadingModel=1

[MS Transaction Server]
AutoRefresh=1




****OnlineStoreProcs.cls****(opened with VB)
Option Explicit


Public Sub RecordHit(TheSession As ASPTypeLibrary.Session, _
    PageName)
    Dim Conn As New ADODB.Connection
    Dim RSVisitorID As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    If IsEmpty(TheSession("VisitorID")) Then
        Conn.Execute "Insert Into C20Visitors (" _
            & "DateTimeEntered) Values (" _
            & "'" & Now & "')"
        Set RSVisitorID = Conn.Execute("Select Max(VisitorID) " _
            & "as MaxID from C20Visitors")
        TheSession("VisitorID") = RSVisitorID("MaxID")
    End If
    Conn.Execute "Insert Into C20PageViews (VisitorID, " _
        & "WhenVisited, PageName) Values (" _
        & TheSession("VisitorID") & ", " _
        & "'" & Now & "', '" _
        & PageName & "')"
End Sub

Public Function CategoryList()
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName from " _
        & "C20Categories Order By CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<OPTION VALUE=""" _
            & RSCategories("CategoryName") & """>" _
            & RSCategories("CategoryName") & "</OPTION>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    CategoryList = TempReturn
End Function

Public Function SubCategories(ParentCategory, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "ParentCategory = '" & ParentCategory & "' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategories = TempReturn
End Function

Public Function SubCategoriesInSearch(SearchText, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "CategoryName Like '*" & SearchText & "*' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategoriesInSearch = TempReturn
End Function

Public Function ProductsInCategory(CategoryName, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where CategoryName = '" _
        & CategoryName & "' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInCategory = TempReturn
End Function

Public Function ProductsInSearch(SearchText, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where BriefDescription Like '*" _
        & SearchText & "*' or ProductName Like '*" & SearchText _
        & "*' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInSearch = TempReturn
End Function

Public Function GetProductName(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductName from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductName = RSProduct("ProductName")
End Function

Public Function GetProductPrice(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductPrice from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductPrice = RSProduct("Productprice")
End Function

Public Function GetProductBrief(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select BriefDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductBrief = RSProduct("BriefDescription")
End Function

Public Function GetProductLong(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select LongDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductLong = RSProduct("LongDescription")
End Function

Public Function GetIconPath(ProductID)
Dim Conn As New ADODB.Connection
Dim RSProduct As ADODB.Recordset
If Not IsNumeric(ProductID) Then
Err.Raise vbObjectError + 1, "OnlineStore Server", _
"ProductID must be numeric."
End If
Conn.Open "ASPComp", "sa", ""
Set RSProduct = Conn.Execute("Select Path2Icon from " _
& "C20Products where ProductID = " & ProductID)
If RSProduct.EOF Then
Err.Raise vbObjectError + 2, "OnlineStore Server", _
"ProductID was not found."
End If
GetIconPath = RSProduct("Path2Icon")
End Function

Public Function GetPicturePath(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select Path2Picture from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetPicturePath = RSProduct("Path2Picture")
End Function

Public Sub AddToWishList(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20WishListItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Function GetWishList(VisitorID, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    If Not IsNumeric(VisitorID) Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "VisitorID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select C20Products.ProductName, " _
        & "C20Products.ProductID, C20Products.ProductPrice " _
        & "From C20Products INNER JOIN C20WishListItems ON " _
        & "C20Products.ProductID = C20WishListItems.ProductID " _
        & "Where C20WishListItems.VisitorID = " & VisitorID _
        & " Order By C20Products.ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    GetWishList = TempReturn
End Function

Public Sub AddToShoppingCart(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20OrderItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Sub RemoveFromShoppingCart(OrderItemID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(OrderItemID) Then
        Err.Raise vbObjectError + 4, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Delete From C20OrderItems " _
        & "Where OrderItemID = " & OrderItemID
End Sub

Public Function ShowShoppingCart(TheSession As ASPTypeLibrary.Session, _
    ProductPage, RemovePage)
    Dim Conn As New ADODB.Connection
    Dim RSOrderItems As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSOrderItems = Conn.Execute("Select C20Products.ProductID, " _
        & "C20Products.ProductName, C20Products.ProductPrice, " _
        & "C20Products.ShippingPrice, C20OrderItems.OrderItemID " _
        & "From C20Products INNER JOIN C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where C20OrderItems.VisitorID = " & TheSession("VisitorID"))
    TempReturn = "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 WIDTH=600>" _
        & vbNewLine & "<TR>" & vbNewLine & "<TD><P><B>Product Name</B></TD>" _
        & vbNewLine & "<TD><P><B>Price</B></TD>" _
        & vbNewLine & "<TD><P><B>Shipping</B></TD>" _
        & vbNewLine & "<TD><P><B>Remove from Cart</B></TD>" _
        & vbNewLine & "</TR>" & vbNewLine
    Do Until RSOrderItems.EOF
        TempReturn = TempReturn & "<TR>" & vbNewLine _
            & "<TD><P><A HREF=""" & ProductPage & "?ProductID=" _
            & RSOrderItems("ProductID") & """>" _
            & RSOrderItems("ProductName") & "</A></TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ProductPrice")) _
            & "</TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ShippingPrice")) _
            & "</TD>" & vbNewLine & "<TD><P><A HREF=""" _
            & RemovePage & "?OrderItemID=" & RSOrderItems("OrderItemID") _
            & """>Remove</A></TD>" & vbNewLine & "</TR>" & vbNewLine
        RSOrderItems.MoveNext
    Loop
    TempReturn = TempReturn & "</TABLE>"
    ShowShoppingCart = TempReturn
End Function

Public Function GetOrderTotal(TheSession As ASPTypeLibrary.Session)
    Dim Conn As New ADODB.Connection
    Dim RSTotal As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSTotal = Conn.Execute("SELECT SUM(ProductPrice + ShippingPrice) " _
        & "AS TheSum FROM C20Products INNER JOIN " _
        & "C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where VisitorID = " & TheSession("VisitorID"))
    GetOrderTotal = RSTotal("TheSum")
End Function

Public Function CheckOut(TheSession As ASPTypeLibrary.Session, _
    TheRequest As ASPTypeLibrary.Request)
    Dim Conn As New ADODB.Connection
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Update C20Visitors set " _
        & "YourName = '" & TheRequest.Form("YourName") & "', " _
        & "Email = '" & TheRequest.Form("Email") & "', " _
        & "Address = '" & TheRequest.Form("Address") & "', " _
        & "CSZ = '" & TheRequest.Form("CSZ") & "', " _
        & "PhoneNumber = '" & TheRequest.Form("PhoneNumber") & "', " _
        & "CreditCardType = '" & TheRequest.Form("CreditCardType") & "', " _
        & "CreditCardNumber = '" & TheRequest.Form("CreditCardNumber") & "', " _
        & "ExpirationDate = '" & TheRequest.Form("ExpirationDate") & "', " _
        & "OrderTotal = " & GetOrderTotal(TheSession) & ", " _
        & "Status = 'OrderPlaced' " _
        & "Where VisitorID = " & TheSession("VisitorID")
    TempReturn = TheSession("VisitorID")
    TheSession.Abandon
    CheckOut = TempReturn
End Function

Public Function FAQList()
Dim Conn As New ADODB.Connection
Dim RSQuestions As ADODB.Recordset
Dim TempReturn As String
Conn.Open "ASPComp", "sa", ""
Set RSQuestions = Conn.Execute("Select FaqID, Question " _
& "From C20FAQ")
Do Until RSQuestions.EOF
TempReturn = TempReturn & "<OPTION VALUE=""" _
& RSQuestions("FAQID") & """>" _
& RSQuestions("Question") & "</OPTION>" _
& vbNewLine
RSQuestions.MoveNext
Loop

FAQList = TempReturn
End Function

Public Function GetFAQAnswer(FAQID)
    Dim Conn As New ADODB.Connection
    Dim RSFAQ As ADODB.Recordset
    If Not IsNumeric(FAQID) Then
        Err.Raise vbObjectError + 5, "OnlineStore Server", _
            "FAQID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSFAQ = Conn.Execute("Select Answer from C20FAQ " _
        & "Where FaqID = " & FAQID)
    If RSFAQ.EOF Then
        Err.Raise vbObjectError + 6, "OnlineStore Server", _
            "FAQID was not found."
    End If
    GetFAQAnswer = RSFAQ("Answer")
End Function

Public Sub AddVisitorQuestion(TheName, TheEmail, TheQuestion)
    Dim Conn As New ADODB.Connection
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20VisitorQuestions (VisitorsName, " _
        & "VisitorsEmail, QuestionText) Values (" _
        & "'" & TheName & "', " _
        & "'" & TheEmail & "', " _
        & "'" & TheQuestion & "')"
End Sub





****OnlineStoreProcs****(opened with notepad)
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "OnlineStoreProcs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit


Public Sub RecordHit(TheSession As ASPTypeLibrary.Session, _
    PageName)
    Dim Conn As New ADODB.Connection
    Dim RSVisitorID As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    If IsEmpty(TheSession("VisitorID")) Then
        Conn.Execute "Insert Into C20Visitors (" _
            & "DateTimeEntered) Values (" _
            & "'" & Now & "')"
        Set RSVisitorID = Conn.Execute("Select Max(VisitorID) " _
            & "as MaxID from C20Visitors")
        TheSession("VisitorID") = RSVisitorID("MaxID")
    End If
    Conn.Execute "Insert Into C20PageViews (VisitorID, " _
        & "WhenVisited, PageName) Values (" _
        & TheSession("VisitorID") & ", " _
        & "'" & Now & "', '" _
        & PageName & "')"
End Sub

Public Function CategoryList()
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName from " _
        & "C20Categories Order By CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<OPTION VALUE=""" _
            & RSCategories("CategoryName") & """>" _
            & RSCategories("CategoryName") & "</OPTION>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    CategoryList = TempReturn
End Function

Public Function SubCategories(ParentCategory, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "ParentCategory = '" & ParentCategory & "' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategories = TempReturn
End Function

Public Function SubCategoriesInSearch(SearchText, ProductsPage)
    Dim Conn As New ADODB.Connection
    Dim RSCategories As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSCategories = Conn.Execute("Select CategoryName " _
        & "From C20Categories where " _
        & "CategoryName Like '*" & SearchText & "*' order by " _
        & "CategoryName")
    Do Until RSCategories.EOF
        TempReturn = TempReturn & "<A HREF=""" _
            & ProductsPage & "?CategoryName=" & RSCategories("CategoryName") _
            & """><FONT FACE=""Arial,Helvetica,Univers,Zurich BT"">" _
            & RSCategories("CategoryName") & "</FONT></A><BR>" _
            & vbNewLine
        RSCategories.MoveNext
    Loop
    SubCategoriesInSearch = TempReturn
End Function

Public Function ProductsInCategory(CategoryName, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where CategoryName = '" _
        & CategoryName & "' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInCategory = TempReturn
End Function

Public Function ProductsInSearch(SearchText, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select ProductID, ProductName, " _
        & "ProductPrice from C20Products where BriefDescription Like '*" _
        & SearchText & "*' or ProductName Like '*" & SearchText _
        & "*' Order By ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    ProductsInSearch = TempReturn
End Function

Public Function GetProductName(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductName from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductName = RSProduct("ProductName")
End Function

Public Function GetProductPrice(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select ProductPrice from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductPrice = RSProduct("Productprice")
End Function

Public Function GetProductBrief(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select BriefDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductBrief = RSProduct("BriefDescription")
End Function

Public Function GetProductLong(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select LongDescription from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetProductLong = RSProduct("LongDescription")
End Function

Public Function GetIconPath(ProductID)
Dim Conn As New ADODB.Connection
Dim RSProduct As ADODB.Recordset
If Not IsNumeric(ProductID) Then
Err.Raise vbObjectError + 1, "OnlineStore Server", _
"ProductID must be numeric."
End If
Conn.Open "ASPComp", "sa", ""
Set RSProduct = Conn.Execute("Select Path2Icon from " _
& "C20Products where ProductID = " & ProductID)
If RSProduct.EOF Then
Err.Raise vbObjectError + 2, "OnlineStore Server", _
"ProductID was not found."
End If
GetIconPath = RSProduct("Path2Icon")
End Function

Public Function GetPicturePath(ProductID)
    Dim Conn As New ADODB.Connection
    Dim RSProduct As ADODB.Recordset
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProduct = Conn.Execute("Select Path2Picture from " _
        & "C20Products where ProductID = " & ProductID)
    If RSProduct.EOF Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "ProductID was not found."
    End If
    GetPicturePath = RSProduct("Path2Picture")
End Function

Public Sub AddToWishList(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20WishListItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Function GetWishList(VisitorID, ProductPage)
    Dim Conn As New ADODB.Connection
    Dim RSProducts As ADODB.Recordset
    Dim TempReturn As String
    If Not IsNumeric(VisitorID) Then
        Err.Raise vbObjectError + 2, "OnlineStore Server", _
            "VisitorID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSProducts = Conn.Execute("Select C20Products.ProductName, " _
        & "C20Products.ProductID, C20Products.ProductPrice " _
        & "From C20Products INNER JOIN C20WishListItems ON " _
        & "C20Products.ProductID = C20WishListItems.ProductID " _
        & "Where C20WishListItems.VisitorID = " & VisitorID _
        & " Order By C20Products.ProductName")
    Do Until RSProducts.EOF
        TempReturn = TempReturn & "<B>Product Name: </B><A HREF=""" _
            & ProductPage & "?ProductID=" & RSProducts("ProductID") _
            & """><B></B>" & RSProducts("ProductName") _
            & "</A><BR><B>Price: </B>" _
            & FormatCurrency(RSProducts("ProductPrice")) & "<P>" _
            & vbNewLine
        RSProducts.MoveNext
    Loop
    GetWishList = TempReturn
End Function

Public Sub AddToShoppingCart(TheSession As ASPTypeLibrary.Session, ProductID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(ProductID) Then
        Err.Raise vbObjectError + 1, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20OrderItems (VisitorID, " _
        & "ProductID) values (" _
        & TheSession("VisitorID") & ", " _
        & ProductID & ")"
End Sub

Public Sub RemoveFromShoppingCart(OrderItemID)
    Dim Conn As New ADODB.Connection
    If Not IsNumeric(OrderItemID) Then
        Err.Raise vbObjectError + 4, "OnlineStore Server", _
            "ProductID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Delete From C20OrderItems " _
        & "Where OrderItemID = " & OrderItemID
End Sub

Public Function ShowShoppingCart(TheSession As ASPTypeLibrary.Session, _
    ProductPage, RemovePage)
    Dim Conn As New ADODB.Connection
    Dim RSOrderItems As ADODB.Recordset
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Set RSOrderItems = Conn.Execute("Select C20Products.ProductID, " _
        & "C20Products.ProductName, C20Products.ProductPrice, " _
        & "C20Products.ShippingPrice, C20OrderItems.OrderItemID " _
        & "From C20Products INNER JOIN C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where C20OrderItems.VisitorID = " & TheSession("VisitorID"))
    TempReturn = "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 WIDTH=600>" _
        & vbNewLine & "<TR>" & vbNewLine & "<TD><P><B>Product Name</B></TD>" _
        & vbNewLine & "<TD><P><B>Price</B></TD>" _
        & vbNewLine & "<TD><P><B>Shipping</B></TD>" _
        & vbNewLine & "<TD><P><B>Remove from Cart</B></TD>" _
        & vbNewLine & "</TR>" & vbNewLine
    Do Until RSOrderItems.EOF
        TempReturn = TempReturn & "<TR>" & vbNewLine _
            & "<TD><P><A HREF=""" & ProductPage & "?ProductID=" _
            & RSOrderItems("ProductID") & """>" _
            & RSOrderItems("ProductName") & "</A></TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ProductPrice")) _
            & "</TD>" & vbNewLine _
            & "<TD><P>" & FormatCurrency(RSOrderItems("ShippingPrice")) _
            & "</TD>" & vbNewLine & "<TD><P><A HREF=""" _
            & RemovePage & "?OrderItemID=" & RSOrderItems("OrderItemID") _
            & """>Remove</A></TD>" & vbNewLine & "</TR>" & vbNewLine
        RSOrderItems.MoveNext
    Loop
    TempReturn = TempReturn & "</TABLE>"
    ShowShoppingCart = TempReturn
End Function

Public Function GetOrderTotal(TheSession As ASPTypeLibrary.Session)
    Dim Conn As New ADODB.Connection
    Dim RSTotal As ADODB.Recordset
    Conn.Open "ASPComp", "sa", ""
    Set RSTotal = Conn.Execute("SELECT SUM(ProductPrice + ShippingPrice) " _
        & "AS TheSum FROM C20Products INNER JOIN " _
        & "C20OrderItems ON " _
        & "C20Products.ProductID = C20OrderItems.ProductID " _
        & "Where VisitorID = " & TheSession("VisitorID"))
    GetOrderTotal = RSTotal("TheSum")
End Function

Public Function CheckOut(TheSession As ASPTypeLibrary.Session, _
    TheRequest As ASPTypeLibrary.Request)
    Dim Conn As New ADODB.Connection
    Dim TempReturn As String
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Update C20Visitors set " _
        & "YourName = '" & TheRequest.Form("YourName") & "', " _
        & "Email = '" & TheRequest.Form("Email") & "', " _
        & "Address = '" & TheRequest.Form("Address") & "', " _
        & "CSZ = '" & TheRequest.Form("CSZ") & "', " _
        & "PhoneNumber = '" & TheRequest.Form("PhoneNumber") & "', " _
        & "CreditCardType = '" & TheRequest.Form("CreditCardType") & "', " _
        & "CreditCardNumber = '" & TheRequest.Form("CreditCardNumber") & "', " _
        & "ExpirationDate = '" & TheRequest.Form("ExpirationDate") & "', " _
        & "OrderTotal = " & GetOrderTotal(TheSession) & ", " _
        & "Status = 'OrderPlaced' " _
        & "Where VisitorID = " & TheSession("VisitorID")
    TempReturn = TheSession("VisitorID")
    TheSession.Abandon
    CheckOut = TempReturn
End Function

Public Function FAQList()
Dim Conn As New ADODB.Connection
Dim RSQuestions As ADODB.Recordset
Dim TempReturn As String
Conn.Open "ASPComp", "sa", ""
Set RSQuestions = Conn.Execute("Select FaqID, Question " _
& "From C20FAQ")
Do Until RSQuestions.EOF
TempReturn = TempReturn & "<OPTION VALUE=""" _
& RSQuestions("FAQID") & """>" _
& RSQuestions("Question") & "</OPTION>" _
& vbNewLine
RSQuestions.MoveNext
Loop

FAQList = TempReturn
End Function

Public Function GetFAQAnswer(FAQID)
    Dim Conn As New ADODB.Connection
    Dim RSFAQ As ADODB.Recordset
    If Not IsNumeric(FAQID) Then
        Err.Raise vbObjectError + 5, "OnlineStore Server", _
            "FAQID must be numeric."
    End If
    Conn.Open "ASPComp", "sa", ""
    Set RSFAQ = Conn.Execute("Select Answer from C20FAQ " _
        & "Where FaqID = " & FAQID)
    If RSFAQ.EOF Then
        Err.Raise vbObjectError + 6, "OnlineStore Server", _
            "FAQID was not found."
    End If
    GetFAQAnswer = RSFAQ("Answer")
End Function

Public Sub AddVisitorQuestion(TheName, TheEmail, TheQuestion)
    Dim Conn As New ADODB.Connection
    Conn.Open "ASPComp", "sa", ""
    Conn.Execute "Insert Into C20VisitorQuestions (VisitorsName, " _
        & "VisitorsEmail, QuestionText) Values (" _
        & "'" & TheName & "', " _
        & "'" & TheEmail & "', " _
        & "'" & TheQuestion & "')"
End Sub




****OnlineStore.vbw****
OnlineStoreProcs = 1, -1, 643, 494,


0
 
LVL 9

Accepted Solution

by:
TTom earned 300 total points
ID: 6274457
Have you tried accessing any of the other methods of your component one you instantiate it?

If you are working in Visual InterDev, have you tried setting a reference to your component in your project?

If you have a component referenced in your project, you should be able to see the methods of that component in VID.  If not, the component is not properly registered and referred.

Tom
0
 

Expert Comment

by:shlomof
ID: 6277366
In Visual Interdev, in your line number 5, where you have the following code:

MyOnlineStore.RecordHit Session, "Home"

Try to delete the full stop after the MyOnlineStore and then type it in again.  It should display enum - a list of all object's (OnlineStore.OnlineStoreProcs) methods.  Check if the method RecordHit is there.
0
 

Author Comment

by:chrispkotsiopoulos
ID: 6283595
It was a database connection problem like you said. I replaced the following connection string:
Conn.Open "ASPComp", "sa", ""
which is a SQL Server string with:
Dim str
    str = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=c20.mdb;Persist Security Info=False"
    Conn.Open str
which is a piece of code that uses a DSNless connection string to c20.mdb Access database. The only strange thing is that I initially received an error message saying that "File c:\winnt\system\c20.mdb cannot be found". It was trying to find the database in the above path. I didn't find out why so I put the database in this path and it worked. I also had to change the permissions to the db file and the folder that contain it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now