From: Eduardo on 14 Nov 2009 10:11 Marc Henderson escribi�: > I tried removing the reference to DAO 3.51, and replacing it with 3.6 > and had a number of odd experiences. The database appears to work > fine, navigating from record to record works as expected, etc. Then I > tried one of our menu commands: Compact Database. The result was > Err 3356: You attempted to open a database that is already opened > exclusively by user 'admin' on machine 'SERVER4' ... > > Before we run 'DBEngine.CompactDatabase sDBPath, sDBCompactPath', > we close the database with CloseDB: > ' close the main recordset ( it's declared like this: Global rst > As DAO.Recordset and then Set rst = db.OpenRecordset(strSQL) in > Form1_Load) > > rst.Close > Set rst = Nothing > > ' remove any reference to the Data control > With Form1.Data1 > .DatabaseName = "" > .RecordSource = "" > .Recordset.Close > End With > > db.Close > Set db = Nothing > > DBEngine.Workspaces(0).Close > > This has worked flawlessly for years, and I stepped through it and > nothing unusual happened. > > To confirm that the database was closed I typed > ?DB is nothing > in the debug window > and it returned True > > Similar experience when running Form1_Unload: > CloseDB, didn't close the db and left an ldb file lying around. > > Plus more oddities that don't seem to be *remotely* related to any db > code. > > The obvious question is why is the db not being closed by CloseDB. > > I did a lot of reading on the newsgroups, but couldn't find anything > that would explain this. > > Any help is much appreciated ! > > Marc h Just FYI I recently upgraded a program from DAO 3.51 to DAO 3.6 and I didn't find any problem (so far) and I didn't make any modification to the code. The database closes properly also. But I don't use any bound control, I have all by code.
From: Nobody on 14 Nov 2009 10:28 "Marc Henderson" <genesis77Re-move-this(a)usa.com> wrote in message news:qbdtf5petf2is2s76d6c6963e8n2p7uj8f(a)4ax.com... > tried one of our menu commands: Compact Database. The result was > Err 3356: You attempted to open a database that is already opened > exclusively by user 'admin' on machine 'SERVER4' ... Use "Handle" to see which process have a handle open to the DB: Handle: http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
From: Ralph on 14 Nov 2009 10:28 "Marc Henderson" <genesis77Re-move-this(a)usa.com> wrote in message news:tnbtf55ut1rjc7a7sshfbc1gimnk9agd8r(a)4ax.com... > > Could you please elaborate on > >We DO know he ought to be doing THIS and if it breaks THEM, then screw THEM > >for not doing THIS! > > If you mean our many previous customers who have a db using DAO 3.51 > and we have to 'upgrade' to DAO 3.6, because 3.51 is unsupported in > Win7, that doesn't seem fair to our customers. If we tell them that > you can't use our new version, that doesn't seem fair either. And I'm > not sure what you mean by "We DO know he ought to be doing THIS ,,,." > Can you please be more specific ? > Ha, what you just said about fairness to your customers is exactly what I meant. My comment was only an attempt at humor in response to Mr. Toews' remark specifically and a few other's replies in general. It was not directed at you or at your OP. [Also before I go farther I want you to know I do respect these people. They are experienced VBers who are sincere in their suggestions, just IMHO a tad overzealous for their own solution/s.] I was attempting to show the absurdities of a far too common scenario. An OP asks a question concerning ItemA, could be a product, component, a nuance, a library, or anything. Someone will come along and suggests the OP shouldn't be using ItemA, he should be using ItemB. Often for quite valid reasons. The OP then replies they can't use ItemB because of their boss, some other suite, their clients, or ... At which time someone will inevitably come back with - "I don't care what problems switching to ItemB might be - ItemB is the answer and THEY will just have to adjust.". The "THEY" in Toews' comment was the clients, but it can also be the OP or anyone else who doesn't recognize the superiority of using ItemB. <g> In this case it was even more absurb as no one knows WHY you are using ItemA. Now for something different .... If the term "unsupported" bothered you Mr. Toews gave some very good reasons for switching to another version which is more "supported",. You might want to consider them. However, Jeff answered your question quite distinctly: "unsupported" <> "does not work" "unsupported" = "we won't be fixing any bugs in it ever again" You can make you decision based on that. And of course I'm in love with my own answer: "If it ain't broke, don't fix it." -ralph <g>
From: Ralph on 14 Nov 2009 10:51 "Marc Henderson" <genesis77Re-move-this(a)usa.com> wrote in message news:qbdtf5petf2is2s76d6c6963e8n2p7uj8f(a)4ax.com... > "Tony Toews [MVP]" <ttoews(a)telusplanet.net> wrote: > > I tried removing the reference to DAO 3.51, and replacing it with 3.6 > and had a number of odd experiences. The database appears to work > fine, navigating from record to record works as expected, etc. Then I > tried one of our menu commands: Compact Database. The result was > Err 3356: You attempted to open a database that is already opened > exclusively by user 'admin' on machine 'SERVER4' ... > <snipped> > > Similar experience when running Form1_Unload: > CloseDB, didn't close the db and left an ldb file lying around. > > Plus more oddities that don't seem to be *remotely* related to any db > code. > You have run into the "object lifecycle" differences between DAO 3.5 and 3.6 I alluded to in another post. It has been awhile since I fought these wars, so it will take me time to go back to my notes ... in the meantime, it will be helpful if you will publish the exact data control/s, the connectionstring or method you are connecting with IF different from the default Jet, and the specific Jet file format you are working with. You can get the control information from the .vbp file. Also be aware that the changes you will have to make are mostly structural - ie, you will just have to re-arrange your code and/or insert a new line here or there. It is possible you may need to swap controls (which can be done using a text editor). But nothing else more exotic will be necessary. ie, DON'T PANIC. lol -ralph
From: Ralph on 14 Nov 2009 12:18
Also are you using any "user-level" security - defining access or ownership? -ralph |