Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception error on do while.eof?

Status
Not open for further replies.

false420

Programmer
Mar 31, 2005
87
US
I just recently upgraded from ms access to sql server so there is a few quirks. this one is puzzling me. it begins to enter into a do while section and create an exception error. im not sure why. hopefully a pro may know.
If GLRecordCount > 0 Then
objRS_UsersGL.MoveFirst
GLholder = ""
GLholder2 = ""
Do While Not objRS_UsersGL.EOF
ERROR HERE --> GLholder = GLholder & objRS_DisapprovedNoNote("Service") & "." & objRS_UsersGL("Segment") & ", "
GLholder2 = GLholder2 & objRS_DisapprovedNoNote("Service") & "." & objRS_UsersGL("Segment") & ", "
CCSindex = CCSindex + 1
objRS_UsersGL.MoveNext
Loop

End If



ERROR:
error '80020009'
Exception occurred.

/a_invoicesDisplayDisapprovalNote.asp, line 119


if you need any info id be glad.
 
What is objRS_DisapprovedNoNote ?
Is the error raised on the 1rst iteration or only when GLholder becomes too big ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Dim strDisapprovedNoNote, objRS_DisapprovedNoNote, notCheckedCounter
strDisapprovedNoNote = "SELECT * FROM InvoiceApproval WHERE Month_Date >= '" & Option_Date & "' AND Month_Date < '" & toDate & "' AND Disapproved = 1 AND DisapprovalDescNum = '" & DisapprovedNoteNum & "' AND Cost_Center = '" & Request("CC") & "' AND Carrier = '" & Request("Car") & "' AND Account = '" & Request("Acc") & "' Order By Service, Cost_Center, Carrier, Account"
Set objRS_DisapprovedNoNote = Server.CreateObject("ADODB.Recordset")
objRS_DisapprovedNoNote.Open strDisapprovedNoNote,objConnHD, adOpenKeyset



Its raised the first time its called, i cant even do a response.write to see whats in it.
 
To better know what raises the error you may split the line:
GLholder = GLholder & objRS_DisapprovedNoNote("Service") & "."
GLholder = GLholder & objRS_UsersGL("Segment") & ", "


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Do While Not objRS_UsersGL.EOF
GLholder = GLholder & objRS_DisapprovedNoNote("Service") & "." & objRS_UsersGL("Segment") & ", "
---------> response.write GLholder
GLholder2 = GLholder2 & objRS_DisapprovedNoNote("Service") & "." & objRS_UsersGL("Segment") & ", "



It wont do it
 
GLholder = GLholder & objRS_DisapprovedNoNote("Service") &_

"." & objRS_UsersGL("Segment") & ", "

still points to the first one. do you think it may be deep in the code somewhere? this is rough
 
I don't suggested a continued line but 2 lines.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
GLholder = GLholder & objRS_DisapprovedNoNote("Service")& "."
GLholder = GLholder & objRS_UsersGL("Segment") & ", "

still points to the first line
 
i took that line out and it gives same error for glholder 2
 
So, the problem seems to be with objRS_DisapprovedNoNote.
Have you tested the BOF and EOF property of this recordset after the Open call ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
it only happens with & objRS_DisapprovedNoNote("Service")

if i take it out and leave the later RS then it no error
 
no, i only tested the latter RS GLusers and the EOF and BOF works. why wouldnt it work with one and not the other?
 
i only use EOF for the GLuser RS to exit the loop.
 
why wouldnt it work with one and not the other?
Because they are different recordset.
Perhaps the SQL code of objRS_DisapprovedNoNote is faulty or returns no row...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
SELECT * FROM InvoiceApproval WHERE Month_Date >= '2/16/2005' AND Month_Date < '3/1/2005' AND Disapproved = 1 AND DisapprovalDescNum = '' AND Cost_Center = '101.80360.40000204' AND Carrier = 'Sprint PCS' AND Account = '0-038128403-8' Order By Service, Cost_Center, Carrier, Account

is what response.write of

strDisapprovedNoNote = "SELECT * FROM InvoiceApproval WHERE Month_Date >= '" & Option_Date & "' AND Month_Date < '" & toDate & "' AND Disapproved = 1 AND DisapprovalDescNum = '" & DisapprovedNoteNum & "' AND Cost_Center = '" & Request("CC") & "' AND Carrier = '" & Request("Car") & "' AND Account = '" & Request("Acc") & "' Order By Service, Cost_Center, Carrier, Account"


shows
 
i think it may lie with DisapprovalDescNum
there is no value
 
And what are the values of objRS_DisapprovedNoNote.BOF and objRS_DisapprovedNoNote.EOF after this line ?
objRS_DisapprovedNoNote.Open strDisapprovedNoNote,objConnHD, adOpenKeyset

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
i found it, it was putting nulls into the sql server under disapprovaldescnum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top