Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2006, 12:20 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP PLEASE!! error '80020009'

Help! I am really stuck with this problem.

I'm trying to do a loop through two recordsets, and it works perfectly if I use Response.Write on the individual values, but dies as soon as I try and make it a string.

Code is:

Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open strCon

Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.Open "SELECT * FROM tblOrders WHERE Invoiced = 'No' AND Shipped = 'Yes';",adoCon,1,2

Set rsInvoiceNumber = Server.CreateObject("ADODB.Recordset")
rsInvoiceNumber.Open "SELECT * FROM tblInvoiceNumber;",adoCon,1,2

intInvoiceNumber = rsInvoiceNumber("InvoiceNumber") + 1

Do While Not rs2.EOF

    Set rs3 = Server.CreateObject("ADODB.Recordset")
    rs3.Open "SELECT * FROM tblOrderDetails WHERE OrderID = " & rs2("ID") & ";",adoCon,1,2

        Do While Not rs3.EOF

        Set adoCustomerCon = Server.CreateObject("ADODB.Connection")
        adoCustomerCon.Open strCon

        Set rsCustomer = Server.CreateObject("ADODB.Recordset")
        rsCustomer.CursorLocation = 3 'adUseClient
        rsCustomer.CursorType = 3 'adOpenStatic
        rsCustomer.ActiveConnection = adoCustomerCon
        rsCustomer.Open "SELECT * FROM tblCustomerData WHERE ID = " & rs3("CustomerID") & ";"

        Headers = ""
        Headers = Headers & rsCustomer("CompanyName") & ","

The error is on Headers = Headers & rsCustomer("CompanyName") & ","

Yet, if I take out the Headers part and do Response.Write rsCustomer("CompanyName") it's fine????

Thanks

 
Old April 28th, 2006, 12:52 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;but dies as soon as I try and make it a string

Please define 'but dies'
FYI: Next time include the exact syntax of the un friendly http error. It also helps pointing out the problematic line number if possible

Have you dimmed your variable Headers? Eg:
dim Headers

Do you use <% Option Explicit %> in the head of all your pages? If you did the error would tell you to dim the variable. If not you will be confused as you are now. Unless you have a good reason not to, not using <% Option Explicit %> is unwise.

Wind is your friend
Matt
 
Old April 28th, 2006, 06:49 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,

Yes, I do use <% Option Explicit %> in the head of the pages. The exact error message is:

error '80020009'
/trade/master-admin-invoicing.asp, line 49

Line 49 is:
Headers = Headers & rsCustomer("CompanyName") & ","

It is the first time I am adding any specific value to Headers, and yes, everything has a Dim value.

Cheers

 
Old April 29th, 2006, 02:20 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Replace:
Headers = Headers & rsCustomer("CompanyName") & ","
With:
response.write rsCustomer("CompanyName") & "=value"

Does this recorset has a value? I think one of your (probably this one) recordsets is .eof

Wind is your friend
Matt




Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
error '80020009' Exception occurred. hauruapai Classic ASP Basics 2 April 10th, 2006 05:05 PM
ADODB.Field error '80020009' EricTheViking Access ASP 2 August 16th, 2005 12:45 AM





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