Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Reports with Data Report Designer? 2

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I have a MS Access Database as a backend to a Time Management program (VB 6 front-end) I'm working on, and I've created numerous reports. I read somewhere that you can create a new DataReport and set the DataMember and DataSource properties and it will retrieve the report. Has anyone done that successfully, and can you show me how?

Or... can I do this inside the VisData add-in?

I'm using ADO to interact with the Access 2000 database, and just recoded the VisData so that it recognizes Access 2000 format databases.

Thanks for any help!

jason
 
Disclaimer: I use Access 97, not 2000 - If I'm wrong, don't blame me!

You seem to be halfway between two solutions -

1. If you *KNOW* Access will be installed on the target machine, you could use Automation to open the desired report from Access.

2. That DataReport will only work with DataEnvironment added and set up first. Once your DataEnvironment is pointing to the correct dataset, you should be able to design the report pretty much like you would an Access Report.

(And the DataEnvironment can be a small novel in itself !)
 
The reason I'm doing this is so that the user does not require Access to be installed on the target machine.

The program is designed to run over a company intranet, with the database residing on the main server.

I wasn't aware that the DataEnvironment needed to be set up... I'm off to set that up now =^)

jason
 
Jasek,

I've just finished reading your thread and I've got a question for you. How did you manache to recognize Access 2000 with VisData. I've been looking for that solution for weeks and until know nobody has answered me.
Please write me back on this e-mail:

lmikesk@az.vub.ac.be

Thx
Live fast, die young and leave a beautiful corpse behind.
 
Hi Jasek,

How did you manage to recognize Access 2000 with VisData. I've been looking for a solution to that problem for a while now and until now I have not found a solution.
Could you please Instruct me on how to do this.

Thanx
Hugh
>:):O>
"If at first you don't succeed , USE a BIGGER Hammer....."

 
I found a solution at

here's the cut and pasted instructions

1. Update the DAO Reference from DAO 3.51 to DAO 3.60.
(This step alone is sufficient to allow you to open and work with Access 2000 files.)


1. Open Visdata.vbp in the Visual Basic design environment.


2. On the Project menu, open the list of References.


3. Deselect the existing reference to Microsoft Data Access Objects 3.51, and then locate and select Microsoft Data Access Objects 3.60. If you are using Visual Basic 6.0, be sure to move the DAO 3.6 reference above the ADO library reference in the list.


2. Add a new menu item and code to allow creating a new Access 2000 database.


1. Open the main form, frmMDI, in the design environment.


2. From the Tools menu, open the Menu Editor.


3. In the Menu Editor window, scroll down in the existing menu items to File / New / Microsoft Access.


4. In order to insert the new menu item after the existing entry for Access Version 7.0 MDB files, select the following entry: dBase. Click the Insert button, and then click the RIGHT ARROW button to make the new, blank entry a subitem under the Microsoft Access heading. Enter Access 2000 as the Caption and mnuDBNMDB2K as the Name. Close the Menu Editor by clicking OK.


5. Open the frmMDI code module and select the mnuDBNMDB2K_Click event procedure in the drop-down list. Enter the following line of code:


NewMDB dbVersion40

3. In Visual Basic 6.0 only, update ADO connection strings to support Access 2000. VisData uses both DAO and ADO. Use the Search function on the Visual Basic Edit menu to locate all references in the project to the Microsoft Jet OLE DB Provider version 3.51 and update 3.51 to 4.0.


4. In Visual Basic 6.0 only, add code that will enable the Grid toolbar button, which displays a table of records in a DBGrid control rather than one record per form.


1. Open the module modVisData and find the OpenTable procedure. After the lines:

If gsDataType = gsMSACCESS Then
.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & gsDBName

insert the additional line:


.CursorLocation = adUseClient

2. Then open frmDataGrid and find the Form_Load event procedure. After the line:

Set datDataCtl.Recordset = mrsFormRecordset

insert the additional lines:

datDataCtl.Refresh
Set grdDataGrid.DataSource = datDataCtl
grdDataGrid.Refresh

If you were to omit this step, you might see an empty grid; or the grid may display with the very first cell empty.


5. Recompile the VISDATA project and copy the compiled executable to the Visual Basic directory (which is \Program Files\Microsoft Visual Studio\Vb98 by default in Visual Basic 6.0).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top