Data Report without Data Environment 
Author Message
 Data Report without Data Environment

Hi
Does anyone have an example of linking ADO recordset (generated by code) to
a Data Report without using a Data Environment?

I really appreciate you reply in advance.

Regards

Med



Sun, 20 Jul 2003 17:56:49 GMT  
 Data Report without Data Environment
Briefly:
Go to Project->References and check Microsoft Active Data Object x.y
(current version is 2.6 and it is STRONGLY recommended that you update your
version (if necessary) - visit www.microsoft.com/data )

Dim dcn As ADODB.Connection
Dim rs As ADODB.Recordset
'
'
Set dcn = New ADODB.Connection
Set rs = New ADODB.Recordset

dcn.connectionstring = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\my
documents\database.mdb"
'MS Jet 3.51 is the provider for MS Access 97 etc etc, database.mdb is
Access file you want to open...
dcn.open
rs.cursorlocation=adUseClient
rs.Open "SELECT * FROM table",dcn    ' sure you can use your own SQL
statment here
..
' now let's say you use Microsoft Data Grid control to display the data
(DataGrid1 is on the Form or wherever)
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
..
..
rs.close
dcn.close
set rs=nothing
set dcn=nothing

etc etc

Get yourself a book on ADO !!! :)))

---------
degojs
'
'
'

Quote:
> Hi
> Does anyone have an example of linking ADO recordset (generated by code)
to
> a Data Report without using a Data Environment?

> I really appreciate you reply in advance.

> Regards

> Med



Fri, 25 Jul 2003 12:48:50 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help! Data Report without Data Environment

2. Data Report without Data Environment

3. printing without crystal report or data report for non data base reports

4. Data Environment / Data Report Problem

5. Showing parameters pass to data environment in data report header

6. data report / data environment designers

7. Data Environment / Data Report / Changing database file at run time

8. VB6 Data Environment & Data Report

9. Problem with Data Environment and Data Report

10. help - data environment and data reports

11. Data Environment / Data Report Problem

12. Showing parameters pass to data environment in data report header

 

 
Powered by phpBB® Forum Software