Forum Home Forum Home > Legacy Products > SalesCart Standard / PRO / SQL
  New Posts New Posts RSS Feed - sendemail.asp error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum Lockedsendemail.asp error

 Post Reply Post Reply
Author
Message
jason2004 View Drop Down
Groupie
Groupie


Joined: September/29/05
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote jason2004 Quote  Post ReplyReply Direct Link To This Post Topic: sendemail.asp error
    Posted: July/16/06 at 9:21pm
sendemail.asp

Microsoft VBScript runtime error '800a01fa'

Class not defined: 'CSimpleAdo'

/cgi-bin/sendemail.asp, line 17



Line 17 is:
     Set SimpleAdo = New CSimpleAdo
     SimpleAdo.setConnectionString = Session("ConnectionString")
     Set RS = SimpleAdo.getRecordSet(SQLStmt)

Any idea what's wrong?
SalesCart Pro 5

Back to Top
mikeb View Drop Down
Admin Group
Admin Group
Avatar

Joined: March/17/04
Location: United States
Status: Offline
Points: 194
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikeb Quote  Post ReplyReply Direct Link To This Post Posted: July/17/06 at 9:19am
You don't have cmail.asp in cgi-bin
Back to Top
jason2004 View Drop Down
Groupie
Groupie


Joined: September/29/05
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote jason2004 Quote  Post ReplyReply Direct Link To This Post Posted: July/17/06 at 4:33pm
Originally posted by mike mike wrote:

You don't have cmail.asp in cgi-bin

I do have CMail.asp in cgi-bin folder.

<%
'----------------------------------------------------------- ---------
' CMail.asp
'
' Copyright (c) 1995-2003 ComCity Corporation. All Rights Reserved.
'
'
'
' Define all Function Calls, Subroutines, and classes in this file
'
'     CREATED February 19, 2001 by ip
'
'     MODIFICATIONS
'----------------------------------------------------------- ---------
'     3/19/01   &nbs p; mtb        & nbsp; Needs Release 1.0
'     1/14/03   &nbs p; wc        &n bsp; Updated to use Bamboo
'     1/29/03 wc         &nbs p;Updated to use JMail
'     2/4/03 wc         &nbs p;Updated Bamboo to send mail using objMail.Send instead of objMail.SendMail
'     3/27/03 wc         &nbs p;Updated to use Persits ASPEmail
'     7/2/03 wc         &nbs p;Updated CDONTS to have option to send HTML-based email
'     7/2/03 wc         &nbs p;Updated to send via CDOSYS
'
'----------------------------------------------------------- ---------
'     EXAMPLE
'
'Use ScCdo for CDONTS, ScAspMail for Serverobject's ASPMail, Bamboo for Bamboo Email, JMail for JMail,
'ScAspEmail for Persits ASPEmail, CDOSYS for CDOSYS
'
'The AddToAddress takes three parameters Name, email, address, type(1=To, 2=Cc, 3=Bcc)
'these are all required or you will get an error. Each Name must be unique. If you
'don't have a name just pass up a made up one. or the email address.
'
'Set objMail = New CMail
'objMail.SetPluginType = "ScCdo"
'objMail.SetFromAddress=mymail
'objMail.AddToAddress "Jim Bim", toaddress, 1
'objMail.AddToAddress "Old Granddad", ccaddress, 2
'objMail.AddToAddress "Johnny Walker", bccaddress, 3
'objMail.SetSubject=mysubject
'objMail.SetBody=themessage
'mailres=objMail.SendMessage()
'Set objMail = Nothing
'----------------------------------------------------------- ---------
'**Start Encode**
Back to Top
mikeb View Drop Down
Admin Group
Admin Group
Avatar

Joined: March/17/04
Location: United States
Status: Offline
Points: 194
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikeb Quote  Post ReplyReply Direct Link To This Post Posted: July/17/06 at 4:46pm
Sorry not Cmail. Csimpleado.asp is the class that holds csimpleado.   Either its not in the cgi-bin or it can't find it because of pathing/relative pathing issues you have introduced somehow.
Back to Top
jason2004 View Drop Down
Groupie
Groupie


Joined: September/29/05
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote jason2004 Quote  Post ReplyReply Direct Link To This Post Posted: July/18/06 at 2:02am
Originally posted by mike mike wrote:

Sorry not Cmail. Csimpleado.asp is the class that holds csimpleado.   Either its not in the cgi-bin or it can't find it because of pathing/relative pathing issues you have introduced somehow.


I do have CSimpleado.asp in CGI-BIN folder.
I have 2 versions of this file:


One that came with SalesCart Pro 5:
--------------------------------
<%
'----------------------------------------------------------- ---------
' CSimple ADO
'
' Copyright (c) 1995-2003 ComCity Corporation. All Rights Reserved.
'
'
'
' Define all Function Calls, Subroutines, and classes in this file
'
'     CREATED Unknown by ip
'     MODIFICATIONS
'----------------------------------------------------------- ---------
'     Unknown   &nbs p; ip        &n bsp; Created
'     3/16/01   &nbs p; mtb        & nbsp; Incorporation changes for Pro 3.0
'     3/16/01   &nbs p; mtb        & nbsp; Needs Release 2.0
'     5/13/03   &nbs p; wc        &n bsp; Created new function checkSQL to modify SQL statements to conform with SQL Server
'     5/13/03   &nbs p; wc        &n bsp; Updated getRecordSet and ExecuteInsertUpdate functions to use checkSQL function
'
'
'
'----------------------------------------------------------- ---------
'     EXAMPLE
'----------------------------------------------------------- ---------
'Dim objSimpleAdo, rstRS, strSql
'
'strSql = "SELECT * FROM MyTable"
'Set SimpleAdo = New CSimpleAdo
'SimpleAdo.setConnectionString = Session("Connection")
'Set rstRS = SimpleAdo.getRecordSet(strSql)
'Do stuff with the record set
'Set SimpleAdo = Nothing
'Set RS = Nothing
'
'----------------------------------------------------------- ---------
'**Start Encode**#@~^pgsAAA==@#@&@#@&@#@&;Vlk/,/?b:2Vb[G@#@&dh.k7lY ~/W     xmOkGUUY.k  &nbs p;  L@#@&dK.b\lOn,ZGx      ;
-------------------------------------------------


and one I have downloaded:

<%
'----------------------------------------------------------- ---------
' CSimple ADO
'
' Copyright (c) 1995-2003 ComCity Corporation. All Rights Reserved.
'
'
'
' Define all Function Calls, Subroutines, and classes in this file
'
'     CREATED Unknown by ip
'     MODIFICATIONS
'----------------------------------------------------------- ---------
'     Unknown   &nbs p; ip        &n bsp; Created
'     3/16/01   &nbs p; mtb        & nbsp; Incorporation changes for Pro 3.0
'     3/16/01   &nbs p; mtb        & nbsp; Needs Release 2.0
'     5/13/03   &nbs p; wc        &n bsp; Created new function checkSQL to modify SQL statements to conform with SQL Server
'     5/13/03   &nbs p; wc        &n bsp; Updated getRecordSet and ExecuteInsertUpdate functions to use checkSQL function
'
'
'
'----------------------------------------------------------- ---------
'     EXAMPLE
'----------------------------------------------------------- ---------
'Dim objSimpleAdo, rstRS, strSql
'
'strSql = "SELECT * FROM MyTable"
'Set SimpleAdo = New CSimpleAdo
'SimpleAdo.setConnectionString = Session("Connection")
'Set rstRS = SimpleAdo.getRecordSet(strSql)
'Do stuff with the record set
'Set SimpleAdo = Nothing
'Set RS = Nothing
'
'----------------------------------------------------------- ---------
'**Start Encode**


Class CSimpleAdo
     Private ConnectionString
     Private Conn
     Private RS

     Public Property Let setConnectionString(strConn)
               ConnectionString = strConn
     End Property

     Private Function getDataConnection()
               On Error Resume Next
                    Conn.O pen   ConnectionString
               If Err.number <> 0 Then
                    Dim&nb sp;  newConn, posUID
                    newCon n   = ConnectionString
                    posUID    = Instr(1,newConn,"uid",1)
                     If posUID <> 0 Then
                          newConn = Mid(newConn,1,posUID-1)
                    End&nb sp;  If

                    Respon se.Write   "Could not open data connection. Error:<BR>" & Err.Description
                    Respon se.Write   "<p>The Invalid ConnectionString is defined as: " & newConn
                    Respon se.End
                End If
               Set getDataConnection = Conn
     End Function

     Public Function getRecordSet(sql)
               sql = checkSQL(sql)

               Dim conn
               Set conn = getDataConnection()
               RS.CursorType = 3
               RS.CursorLocation = 3
               On Error Resume Next
                    RS.Open   sql,conn
               If Err.number <> 0 Then
                    Response.Write   "Error: <BR>" & Err.Description
                    Exit   Function
               End If
               Set getRecordSet = RS
     End Function

     Public Function ExecuteInsertUpdate(sql)
               sql = checkSQL(sql)

               Dim Conn
               Set Conn = getDataConnection()
               On Error Resume Next
                    Conn.Execute(sql)
                 If Err.number <> 0 Then
                    ExecuteInsertUpdat e = False
               End If
               ExecuteInsertUpdate = True
     End Function

     Public Function checkSQL(SQLStr)
               If Session("DBType") = 1 Then
                    SQLStr   = Replace(SQLStr, "DISTINCTROW ", "")
                    SQLStr   = Replace(SQLStr, "Order.", "[order].")
                    SQLStr   = Replace(SQLStr, "order.", "[order].")

                     If InStr(SQLStr, "DELETE item.Control") Then
                          SQLStr = Replace(SQLStr, "item.Control ", "")
                    End&nb sp;  If

                     If InStr(SQLStr, "DELETE *") Then
                          SQLStr = Replace(SQLStr, "* ", "")
                    End&nb sp;  If

                     If InStr(SQLStr, "AllOrders") Then
                          SQLStr = Replace(SQLStr, "[order].", "")
                          SQLStr = Replace(SQLStr, "#", "'")
                          SQLStr = Replace(SQLStr, "customer.", "")
                          SQLStr = Replace(SQLStr, "[AllOrders]", "AllOrders")
                    End&nb sp;  If

                     If InStr(SQLStr, "ConfirmedOrder") Then
                          SQLStr = Replace(SQLStr, "[order].", "")
                          SQLStr = Replace(SQLStr, "#", "'")
                          SQLStr = Replace(SQLStr, "customer.", "")

                          If InStr(SQLStr, "orderdate like") Then
                               SQLStr = Replace(SQLStr, "like", "=")
                          End If
                    End&nb sp;  If

                     If InStr(SQLStr, "CustomerOrder") Then
                          SQLStr = Replace(SQLStr, "[order].", "")
                          SQLStr = Replace(SQLStr, "#", "'")
                    End&nb sp;  If
               End If


               checkSQL = SQLStr
     End Function

     Private Sub Class_Initialize()
               Set RS = Server.CreateObject("ADODB.RecordSet")
               Set Conn = Server.CreateObject("ADODB.Connection")
     End Sub

     Private Sub Class_Terminate()
               Set Conn = Nothing
               Set RS = Nothing
               'Conn.Close
     End Sub
End Class

%>
--------------------------------------
Which one is the correct?



Edited by jason2004
Back to Top
jason2004 View Drop Down
Groupie
Groupie


Joined: September/29/05
Status: Offline
Points: 87
Post Options Post Options   Thanks (0) Thanks(0)   Quote jason2004 Quote  Post ReplyReply Direct Link To This Post Posted: July/18/06 at 2:07am
What pathing/relative pathing issues you think I might have?

Looking at the code shouldn't the Session ("ConnectionString") be ("SalesCart1_connectionstring") or to leave as it is?


Set SimpleAdo = New CSimpleAdo
     SimpleAdo.setConnectionString = Session("ConnectionString")
     Set RS = SimpleAdo.getRecordSet(SQLStmt)
Back to Top
mikeb View Drop Down
Admin Group
Admin Group
Avatar

Joined: March/17/04
Location: United States
Status: Offline
Points: 194
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikeb Quote  Post ReplyReply Direct Link To This Post Posted: July/18/06 at 8:34am
The version of CSimpleADO that ships with the product is the correct one although that file has undergone very little changes so its doubtful the version is the problem. If the file is in the cgi-bin folder, than the problem is that it cannot find the file.

You should not be changing connection string information. The name of the SalesCart Connection string session variable is "ConnectionString". You don't change this stuff...there never is a reason to even open it up.

Your error message is quite discript.
Class not defined: 'CSimpleAdo'

In other words, I cannot find CSimpleAdo? Where is it? I expect to see it in the same path as where I am as normally defined by an include at the top of the page, but I cannot find it there.

Sendemail.asp normally gets called from receipt2.asp. Does the top of your receipt page have this?:

<!--#include file="codepage.asp"-->
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.04
Copyright ©2001-2015 Web Wiz Ltd.

Copyright 2015 by ComCity® LLC and SalesCart™.  All Rights Reserved