-
July 25th, 2013, 08:39 AM
#1
Error 8577 "Failed to get .... in VB6
Dear All ,
I can successfully show the datareport 1st time when i run the program.but the next time I if I try to show the report,it gives error 8577!!
but if I close(END) the Program & rerun again, the error is gone,again for 1st time.
Please help
Rahul
-
July 25th, 2013, 12:09 PM
#2
Re: Error 8577 "Failed to get .... in VB6
Then, you probably are not CLOSING the DB connection properly... Show the code you use.
-
July 25th, 2013, 10:07 PM
#3
Re: Error 8577 "Failed to get .... in VB6
Code:
Private Sub cmdprint_Click()
'Report.DiscardSavedData
Set rs = New ADODB.Recordset
Set con = New ADODB.Connection
con.Open (Constring)
'Unload Me
If DataEnvironment1.Bill.State = 1 Then
DataEnvironment1.Bill.Close
End If
DataEnvironment1.Bill.Open
billrpt.Sections("Head1").Controls.Item(1).Caption = "" + CStr(billno)
billrpt.Sections("Head1").Controls.Item("Label19").Caption = "Mr./Mrs." & customer
billrpt.Sections("Head1").Controls.Item("Label20").Caption = "Dr." & StrConv(CmbDr.Text, vbProperCase)
Refresh
'MsgBox (StrConv(CmbDr.Text, vbProperCase))
'billrpt.PrintReport showdialog, rptRangeAllPages
'DataEnvironment1.customer
'billrpt.PrintReport ShowDialog, rptRangeAllPages
billrpt.Show vbModal
billrpt.ExportReport rptKeyText, "D:\Invoice Number " & CStr(billno), True, rptRangeAllPages
cmdsave.Enabled = False
cmdprint.Enabled = False
billno = billno + 1
customer.Text = ""
CmbDr.Text = ""
If DataEnvironment1.Bill.State = 1 Then
DataEnvironment1.Bill.Close
Refresh
End If
End Sub
Last edited by GremlinSA; July 26th, 2013 at 06:59 AM.
-
July 26th, 2013, 07:02 AM
#4
Re: Error 8577 "Failed to get .... in VB6
when finished with the dataset where are you closing CON.....
you need a con.close when done...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
July 26th, 2013, 07:05 AM
#5
Re: Error 8577 "Failed to get .... in VB6
Thanks Gremlin,
Was it that small wee problem?
I had worried so much about it..heh heh
Thank you brother.
-
July 26th, 2013, 07:11 AM
#6
Re: Error 8577 "Failed to get .... in VB6
Dear Gremlin
Badluck.!!
It happened again even after putting con.close at the end.
Rahul
-
July 26th, 2013, 07:22 AM
#7
Re: Error 8577 "Failed to get .... in VB6
I typed at the end:
set rs=nothing
set con=nothing
-
July 26th, 2013, 07:33 AM
#8
Re: Error 8577 "Failed to get .... in VB6
just before that add..
rs.close
con.close
best to close it before you set it to nothing......
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
July 26th, 2013, 07:36 AM
#9
Re: Error 8577 "Failed to get .... in VB6
I typed at the end:
rs.close
con.close <<- operation not allowed when the connection is closed.!!! Error msg.
-
July 26th, 2013, 01:37 PM
#10
Re: Error 8577 "Failed to get .... in VB6
It seems that gremlin is offline. So no help until someone really helps !!!
Dglienna I wait for your inputs.
Thanks
Rahul
-
July 26th, 2013, 06:43 PM
#11
Re: Error 8577 "Failed to get .... in VB6
Originally Posted by dsrahul
I typed at the end:
rs.close
con.close <<- operation not allowed when the connection is closed.!!! Error msg.
So am I correct in assuming that you put that after the line that sets con to nothing? That would be a problem.
It would appear that your routine is not using Con nor RS so not sure why they are even there. More likely it is the data environment or the report that is triggering the error. Would help a lot if you showed us what line the error is thrown on and tell us the actual error message rather than the number which we would have to look up.
Always use [code][/code] tags when posting code.
-
July 26th, 2013, 11:42 PM
#12
Re: Error 8577 "Failed to get .... in VB6
Originally Posted by DataMiser
So am I correct in assuming that you put that after the line that sets con to nothing? That would be a problem.
It would appear that your routine is not using Con nor RS so not sure why they are even there. More likely it is the data environment or the report that is triggering the error. Would help a lot if you showed us what line the error is thrown on and tell us the actual error message rather than the number which we would have to look up.
This is the line which is marked in yellow:
billrpt.ExportReport rptKeyText, "D:\Invoice Number " & CStr(billno), True, rptRangeAllPages
and the error Msg is:
-
July 27th, 2013, 12:44 AM
#13
Re: Error 8577 "Failed to get .... in VB6
Well I do not use the data environment nor do I use the VB report tools. I use Active Reports instead which works very well and makes it a bit hard for me to advise using those objects in VB. However
Code:
billrpt.Show vbModal
billrpt.ExportReport rptKeyText, "D:\Invoice Number " & CStr(billno), True, rptRangeAllPages
At a quick glance I am seeing something here that may be trying to Export data from your report after the report has been closed and would therefore fail I would think.
Of course I do not see the rest of the code and maybe you have something in there that hides the report rather than closing it when the user is done with it but the modal call will halt the code just before the export and wait for the form to either be hidden or closed before the next line is allowed to execute and of course if it is closed then whatever data was there is not there any longer.
Always use [code][/code] tags when posting code.
-
July 27th, 2013, 12:58 AM
#14
Re: Error 8577 "Failed to get .... in VB6
Code:
billrpt.ExportReport rptKeyText, "D:\Invoice Number " & CStr(billno), True, rptRangeAllPages
The above mentioned line is just writing a textfile in the Harddrive..so that user is not bothered to click on save report etc.
I have debugged the entire process going on...
When I run the program 1st Time,no error comes out.keeping the same form open if I make another sale, the error fires.
I can give you Teamviewer ID & Password..Please come into my Computer & Check.
[Private info removed]
Last edited by DataMiser; July 27th, 2013 at 01:52 AM.
Reason: Removed private info
-
July 27th, 2013, 01:59 AM
#15
Re: Error 8577 "Failed to get .... in VB6
Sorry but I will not log into your computer. I have also removed the id and password from your post as that could open you up to all sorts of problems. NEVER post that kind of info on a public forum area unless you actually want someone to hijack your system.
But like I said I do not use the data environment in VB, never liked that nor the data controls nor the report tools that comes with it. Instead I always use ADO code for data handling and always use active reports for reporting functions.
The Modal part is the only thing there that jumps out at me and like I said unless you are preventing the form from being closed elsewhere before it returns control the the code shown I would expect it to crash on that very line you pointed out.
If it were an issue of it not being closed properly then I would expect the error to occur before it gets there unless there is something related to the .ExportReport method that needs to be cleaned up after calling it. You may want to check into that.
Always use [code][/code] tags when posting code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|