Home All Groups Group Topic Archive Search About

Releasing lock on MDB file after DataReport1 closes

Author
26 May 2005 10:21 PM
Martin A. Weinberger
Hi all,

I've noticed that if I call DataReport1.Show that after I regain control
after that call that the MDB file that the report used still has a lock on
it, as is evident by the LDB file. I've even tried calling "Unload
DataReport1" and still the same thing. Only when my application closes does
the DataReport release the lock. I've tried capturing the Terminate event
and manually closing the connection, but that didn't do anything.

Thank you in advance for any assistance.

--
Martin A. Weinberger
ButterflyVista
http://www.butterflyvista.com/

Author
26 May 2005 11:43 PM
Veign
Are you hooking the DataReport to a DataEnviroment or to a recordset?

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/


Show quoteHide quote
"Martin A. Weinberger" <tg_mweinber***@butterflyvista.com> wrote in message
news:uTtfSFkYFHA.4024@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I've noticed that if I call DataReport1.Show that after I regain control
> after that call that the MDB file that the report used still has a lock on
> it, as is evident by the LDB file. I've even tried calling "Unload
> DataReport1" and still the same thing. Only when my application closes
does
> the DataReport release the lock. I've tried capturing the Terminate event
> and manually closing the connection, but that didn't do anything.
>
> Thank you in advance for any assistance.
>
> --
> Martin A. Weinberger
> ButterflyVista
> http://www.butterflyvista.com/
>
>
Author
27 May 2005 12:45 AM
Martin A. Weinberger
Hi Veign,

> Are you hooking the DataReport to a DataEnviroment or to a recordset?

Thank you for responding to my request. The answer to your question is no.

Steps:
1. I created a DataEnvironment1 using the designer. I created a parent
command that uses a custom "SQL Statements". I then added three sub-commands
to the parent command, which are also defined by their own unique "SQL
Statements".

2. I created a new DataReport using the designer.

3. I set the report's Data Source to point to the data environment created
above.

4. I open up the DataReport1 and the DataEnvironment1 side-by-side and
attempt to drag fields to the form. I can drag any field from the parent
command, just not any from any of the children. If I manually insert a text
box and set the Data Member to point to the sub command, then at runtime I
get an error message that it can't find the data field.

The Data Environment shows the fields for all three sub-domains nicely. I
can see each of the four commands on the data source for the main report. I
just can't see the sub commands, when trying to insert a field. BTW, when I
drop down the ComboBox for the Data Member of a text box, I only see the
main command. Each sub command does relate back to the parent.

Any thoughts?

--
Martin A. Weinberger
ButterflyVista
http://www.butterflyvista.com/
Author
27 May 2005 12:12 AM
Veign
From a post by Jeff Johnson:

"You have posted this question individually to
multiple groups. This is called Multiposting
and it's BAD. Replies made in one group will
not be visible in the other groups, which
may cause multiple people to respond to your
question with the same answer because they
didn't know someone else had already done it.
This is a waste of time.

If you MUST post your message to multiple
groups, post a single message and select all
the groups (or type their names manually,
separated by commas) in which you want it to
be seen. This is called Crossposting and when
used properly it is GOOD."

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/


Show quoteHide quote
"Martin A. Weinberger" <tg_mweinber***@butterflyvista.com> wrote in message
news:uTtfSFkYFHA.4024@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I've noticed that if I call DataReport1.Show that after I regain control
> after that call that the MDB file that the report used still has a lock on
> it, as is evident by the LDB file. I've even tried calling "Unload
> DataReport1" and still the same thing. Only when my application closes
does
> the DataReport release the lock. I've tried capturing the Terminate event
> and manually closing the connection, but that didn't do anything.
>
> Thank you in advance for any assistance.
>
> --
> Martin A. Weinberger
> ButterflyVista
> http://www.butterflyvista.com/
>
>