473,473 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

data report

slapshock
57 New Member
hi!!!
can u help me with my problem??

i dont know how to put two recordset in one datareport at the same time...or getting data from two tables and put in one datareport....
i tried but it wont work....i dont know how to do it....
pls help me

i am new in programming....
i hope that you can help me...
i am using vb 6.0

tnx in advance...
Dec 19 '06 #1
2 1049
axtens
32 New Member
My experience is more on the VBScript side and VB itself. Given that, assuming you are using ADO to access the databases, create separately named recordsets.

These are the functions I use for database stuff. Making them more VBish shouldn't be too hard.
Expand|Select|Wrap|Line Numbers
  1. function OpenDatabase( theFile )
  2.     Dim oConnection
  3.     On Error Resume Next
  4.     Set oConnection = CreateObject( "ADODB.Connection" )
  5.     oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & theFile
  6.     If Err.Number <> 0 Then
  7.         Die "OpenDatabase", Err
  8.     End If
  9.     Err.Clear
  10.     On Error GoTo 0
  11.     Set OpenDatabase = oConnection
  12. end function
  13.  
  14. Function OpenRecordSet( ByRef oDB, sQuery )
  15.     Dim oRecordSet
  16.     Set oRecordSet = CreateObject( "ADODB.RecordSet" )
  17.     oRecordSet.Open sQuery, oDB, adOpenStatic, adLockOptimistic
  18.     Set OpenRecordSet = oRecordSet
  19. End Function
Just watch out for the options on the oRecordSet.Open as you may not want an adOpenStatic.

I trust that's heading somewhere in the direction you want to go ...

Kind regards,
Bruce.
Dec 20 '06 #2
aaryan
82 New Member
hi!!!
can u help me with my problem??

i dont know how to put two recordset in one datareport at the same time...or getting data from two tables and put in one datareport....
i tried but it wont work....i dont know how to do it....
pls help me

i am new in programming....
i hope that you can help me...
i am using vb 6.0

tnx in advance...
hi slapshock,
clarify one thing for me, do the data from two tables share a common column, like id or no:, something like that. in that case you can create a parent and child command in the data environment and drag and drop the desired fields in your report.
if the above explanation is not satisfactory, pls elaborate.
Dec 20 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Steven Stewart | last post by:
I have a user who has been using Excel for a while to keep statistics and print reports. She finds using it cumbersome because of long formulas and a lot of copying and pasting. I have designed...
5
by: Greg Teets | last post by:
I am running an Access report from VB via ADO. The report has a field that shows the date it was run. How can I return the data from this field to VB or have Access post it to a table when the...
3
by: Thad | last post by:
I'm new to C# and I was trying to create a Crystal Report. I've designed a simple report and I've used several methods for attaching fields to the report at design time. I've used a DataSet that...
3
by: Diggler | last post by:
I was working on a report that is populated with three different tables in a strongly-typed dataset. The tables are populated from custom objects rather than directly from SQL Server. I loop...
6
by: Ray | last post by:
Hi all, While I use the ReportDocument of vb.net to set filter to the data to the Crystal Report, it is successful for the first time while running the program. However, for the second time while...
0
by: Ray | last post by:
Dear Bernie, Yes, if the same pfieldname is used. The same data will be filtered. But I only use the code shown you before. I have not used any dataset or datatable. How to fix the problem?...
1
by: Andrew Hall | last post by:
Can any one tell me how to report "no data" from a subreport to the main report. The "On No Data" in the subreport does not fire when the main report runs The "On No Data" in the main wont fire...
1
by: Rich | last post by:
Hello, I am trying to use the Reportviewer control. I have been following an example from the web, and the instructions from the help files on set up a ..rdlc and binding it to the reportviewer...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
4
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.