PDA

Click to See Complete Forum and Search --> : MS JET complaint--File already in Use


capt_alberta
Nov 17th, 2000, 09:52 PM
My VB6 data entry project involves a global class module (gRecsClass) that manipulates a DAO datacontrol on each of six different forms.

In frmMain I have declared WorkingForm as Form and assigned it the name of the selected form (to standardize several routines).

In order to use the VB6 report package I have had to use an ADO connection.

The problem -- if the WorkingForm has a recordset, it won't go away! Setting gRecsClass = Nothing and WorkingForm = Nothing won't release the file. (The actual form is also set to nothing in the Form_Unload Event.)

If you enter data and then try to print the report, MSJet complains that the file is still open and won't use the ADO connection.

However, using the ADO recordset first does not interfere with opening the DAO WorkingForm to enter data.

What am I missing (or is there a "Gotcha" lurking somewhere in the wings)?

parksie
Nov 18th, 2000, 08:33 AM
I think there must be an incompatibility between DAO and ADO (duh). I would suggest always using either DAO or ADO. If you specifically need ADO for the VB6 report designer, then use ADO for everything. It also removes the need to distribute two sets of DB access code.