Print Page | Close Window

Add record from ADODB.Recordset

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=6789
Printed Date: 17 June 2024 at 6:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add record from ADODB.Recordset
Posted By: naikosen
Subject: Add record from ADODB.Recordset
Date Posted: 03 April 2007 at 5:49am
I am new to this software.
 
I could not load data from a .mdb using adodb.recordset in the Report control to use as ListView.
 
Will you please kindly guide me in 'loading, adding, editting, updating' like work in the Report control?



Replies:
Posted By: naikosen
Date Posted: 03 April 2007 at 6:00am
Again, guide me what is wrong with the attached project 'Report Try.zip'.
I could not load data from the database. I tried a lot in many ways, but winced.
 
https://forum.codejock.com/uploads/20070403_055845_Report_Try.zip - uploads/20070403_055845_Report_Try.zip
 
Help me, please.


Posted By: naikosen
Date Posted: 03 April 2007 at 6:53pm
No body seems to help me in this topic.
Is this topic sounding stupidity?


Posted By: OscarM
Date Posted: 04 April 2007 at 3:16am
Hi, change
Set pItem = Record.AddItem(adoRS!CompanyName)
with
Set pItem = Record.AddItem(adoRS.Fields.Item("CompanyName").Value)



Posted By: jcollier
Date Posted: 04 April 2007 at 10:17am
Or:

Set pItem = Record.AddItem(CStr(adoRS!CompanyName))


Posted By: naikosen
Date Posted: 04 April 2007 at 7:11pm
Hi
My many many thanks goes to 'OscarM' and 'jcollier'
Thank you so much for your nice help.


Posted By: naikosen
Date Posted: 04 April 2007 at 9:00pm
One more time, please!
 
How can I convert it to Virtual Mode?


Posted By: jcollier
Date Posted: 05 April 2007 at 11:18am
The Online Documentation has step by step instructions and an example.  Just go to the help file and search for SetVirtualMode


Posted By: naikosen
Date Posted: 05 April 2007 at 11:39am
Once I had gone through the online documentation. It has just the simple instruction without adding data from a database.
 
I want to add data from a database in virtual mode. How can I do that?


Posted By: jcollier
Date Posted: 05 April 2007 at 11:50am
In the Online Documentation, check out

Private
Sub wndReportControl_BeforeDrawRow

In that event, replace the data in the sample with the recordset data.

You should be able to figure it all out with the documentation and the info in this post ;)


Posted By: naikosen
Date Posted: 05 April 2007 at 7:22pm
Hiya 'Jcollier'
 
I tried a lot to get the desired result following the online documentation, but winced.
 
It would be so kind of you to guide me with making necessary changes in the project I uploaded in this topic.


Posted By: naikosen
Date Posted: 06 April 2007 at 6:33pm
I am still waiting


Posted By: naikosen
Date Posted: 07 April 2007 at 8:12pm
Help me pliz. I could not figure out how to do it.


Posted By: jcollier
Date Posted: 09 April 2007 at 10:17am
How many rows are you going to have?  The data only has 93 rows which is not enough to need Virtual Mode


Posted By: naikosen
Date Posted: 09 April 2007 at 6:33pm
My database seems to grow more than 10,000,000.
Moreover, I want to learn the way to add data from a database in Virtual mode.
Guide me please.


Posted By: jcollier
Date Posted: 10 April 2007 at 10:08am
Short of writing the code for you (which I don't have time to do) I'm not sure what else to tell you.  The SetVirtualMode section of the help file has pretty much everything you need except you'll replace the given values with values from the recordset the BeforeDrawRow event.

Also, the example generates 20000 random records.  You won't need to do that part either since you already have your records in the recordset.

So, I think you would do the following:

set your array variable.
Loop through the recordset, adding the values to the array
add a Template record (as it does in the help file)
reportcontrol.populate
reportControl.SetCustomDraw xtpCustomBeforeDrawRow

in BeforeDrawRow set it up to use your columns and your array variable.


Posted By: naikosen
Date Posted: 14 April 2007 at 2:48am
Thank you http://forum.codejock.com/member_profile.asp?PF=1790&FID=37 - jcollier
 
I tried a lot, but winced.
I need a complete example of it.
Correction made to the attached Project will be much appreciated.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net