CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Microsoft VBScript runtime error '800a01a8' - CCDLookup problem

Print topic Send  topic

Author Message
Anj

Posts: 13
Posted: 04/26/2010, 9:56 PM

Microsoft VBScript runtime error '800a01a8'
Hey,

In need of some help to get this script working. Any help is greatly appreciated.

I have a list of users which I have sorted into groups to send different emails. The emails are html pages

The error

Microsoft VBScript runtime error '800a01a8'

Object required: '[string: "SELECT UserID, Conta"]'

/Admin/Planning/EmailMarketing_events.asp, line 26

The Code Problem is *

'Get SQL
Dim SQL
Dim oRS
Dim Connection
Dim ErrorMessage
Dim GroupDesc

Set Connection = New clsDBConnection1
Server.CreateObject("ADODB.RecordSet")
* Set GroupDesc = CCDLookUp("GroupSQL", "tblEmailGroup" , "EmailGroupID =" & DBConnection1.ToSQL (tblEmailMarketing1.EmailGroupID.Value, ccsInteger), DBConnection1)

oRS.Open GroupDesc, Connection, 3, 3

ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0

Do While Not oRS.EOF


' Send Mail
Dim Mail

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.wiks.net.au" ' Required
Mail.Port = 25 ' Optional. Port is 25 by default
Mail.From = "mail@wiks.com.au" ' Required
Mail.FromName = "WIKS - Workplace Improvement Kits" ' Optional
Mail.AddAddress Response.Write(oRS("Email")) , Response.Write(oRS("ContactName"))
Mail.Subject = tblEmailMarketing1.Subject.Value
Mail.Body = tblEmailMarketing1.BodyPage.Value
'Mail.AppendBodyFromFile = tblEmailMarketing1.BodyPage.Value
'Mail.AddToBody = True

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
End If

oRS.MoveNext
Loop
View profile  Send private message
TheunisP

Posts: 342
Posted: 04/27/2010, 2:09 AM

I seriously doubt if this line is your error: Set GroupDesc = CCDLookUp("GroupSQL", "tblEmailGroup" , "EmailGroupID =" & DBConnection1.ToSQL (tblEmailMarketing1.EmailGroupID.Value, ccsInteger), DBConnection1)

that lookup will create a SELECT GroupSQL FROM tblEmailGroup WHERE ...

which is nowhere close to

SELECT UserID, Conta ...
View profile  Send private message
Anj

Posts: 13
Posted: 04/27/2010, 5:26 AM

The text in the error relates to the text in the field GroupSQL and should say:

SELECT UserID, ContactName, Company, Email, Group, [Training Interest]
FROM UserTable
WHERE (((UserID)=1));

I think I am calling this incorrectly but am not sure what is the right way to go.
View profile  Send private message
datadoit
Posted: 04/27/2010, 6:58 AM

May or may not be your issue, but you want to avoid using table/field
names using the word "Group".
Anj

Posts: 13
Posted: 04/27/2010, 7:10 AM

Removed "Group" and "[Training Interest]" from SQL and am still having the same problem
View profile  Send private message
Oper


Posts: 1195
Posted: 04/27/2010, 7:55 AM

SET

why SET?

also could you run the as check that the erro in line 26 is that cuase error and line are really different.

_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
TheunisP

Posts: 342
Posted: 04/27/2010, 10:35 AM

you say that the field GroupSQL contains "SELECT UserID, ContactName, Company, Email, Group, [Training Interest] FROM UserTable WHERE (((UserID)=1));" or is that is a variable containg that statement?

View profile  Send private message
TheunisP

Posts: 342
Posted: 04/27/2010, 10:38 AM

let me clarrify my question, you have a table with a field that has SQL statements in it?
View profile  Send private message
TheunisP

Posts: 342
Posted: 04/27/2010, 10:41 AM

just noticed another thing: you have a dim inside a loop? That should be before you hit the loop, otherwise that will only add to your problems
View profile  Send private message
Anj

Posts: 13
Posted: 04/27/2010, 4:25 PM

Yes I have a table with a field that has SQL statements in it. The table is called tblEmailGroup and the field with the SQL is called GroupSQL.

Just not sure how to get the email to send to all of the people in the group when the user selects the group on the form.

Will move the Dim statement
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.