To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Dec 23rd, 2005, 06:24 AM   #1
bomayed
Addicted Member
 
Join Date: Aug 05
Posts: 150
bomayed is an unknown quantity at this point (<10)
Very Strange Error in Datareport!!!

I placed a label on a datareport

Then I typed the following command

Private sub Command1_click()

Dim rs as new adodb.recordset
set rs=cm.execute("select sysdate from dual")
set datareport1.datasource=rs

datareport1.sections("section1").contorls.itme("label1").caption="HI"
datareport1.show

I run the program and I follow what it is doing by click on F8 , and every thing seams to be allright , I see the a report with the word HI in it.


Now when I click on the button , without breaking the code or pressing F8 , I get an error message saying ( Operation is not allowed when the object is closed!)


What is going on , can someone explain this to me ?
bomayed is offline   Reply With Quote
Old Dec 23rd, 2005, 07:48 AM   #2
BrailleSchool
PowerPoster
 
Join Date: Apr 05
Location: Debug.Print
Posts: 3,588
BrailleSchool will become famous soon enough (80+)
Re: Very Strange Error in Datareport!!!

Quote:
Originally Posted by bomayed
I placed a label on a datareport

Then I typed the following command

Private sub Command1_click()

Dim rs as new adodb.recordset
set rs=cm.execute("select sysdate from dual")
set datareport1.datasource=rs

datareport1.sections("section1").contorls.itme("label1").caption="HI"
datareport1.show

I run the program and I follow what it is doing by click on F8 , and every thing seams to be allright , I see the a report with the word HI in it.


Now when I click on the button , without breaking the code or pressing F8 , I get an error message saying ( Operation is not allowed when the object is closed!)


What is going on , can someone explain this to me ?
first you need to dim and set the recordset and connection to the database, then you open the recordset, do your sql query and then close the recordset and connection to the database. secondly, this like has a typo:
VB Code:
  1. datareport1.sections("section1").contorls.[b][color=red]itme[/color][/b][color=red][/color]("label1").caption="HI"
__________________
A+, e-Biz+, i-Net+, MCDST, MCP, Network+, Security+, A.A.S (Hons.)
Visual Basic .NET Video Tutorials | Login Form using backend database (.NET) | Useful site for sending email through .NET | Encrypt/Decrypt data in SQL Server 2005 using SQL statements | Writing Managed Stored Procedures in SQL Server 2005 | FREE .NET Calendar Control | Useful WinForm Controls | Regular Expression (Rexex) Library


What I am using:
Microsoft Visual Basic Professional 2005 with .NET Framework 2.0 and Microsoft SQL Server 2005 or MySQL
BrailleSchool is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:55 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.