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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Instances of MSACCESS in background 2

Status
Not open for further replies.

Phooey

Programmer
Feb 14, 2000
111
0
0
GB
I have a database which uses the startup options to launch a logon box (Simple box, Username and password).&nbsp;&nbsp;The code behind the box checks the entered detail against the Users table to see if the username and/or password exists.&nbsp;&nbsp;If the user exists then the Main Menu is displayed.&nbsp;&nbsp;This works fine.&nbsp;&nbsp;<br><br>If the Username and/or password doesn't exist then I use a global variable to count up to 3 attempts before the database closes using the [Red]Docmd.Runcommand acCmdExit[/Red] statement.<br><br>All Recordset and other objects are closed and set to nothing before the code is exited, for any reason.<br><br>If I close the database, for whatever reason, by whatever method, I find that there are multiple instances of MSACCESS still running in the background.<br><br>Does anyone know how to stop this happening?<br><br>Cheers.<br>
 
Mr Phooey,<br><br>I have spent some time looking at this problem. It appears to be due to using the recordset.seek method with a variable name passed as the first argument.<br>This caused Access to close with a thread still running.<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;rst.index=&quot;username&quot;<br>&nbsp;&nbsp;&nbsp;rst.seek array(me![username]),adseekfirsteq<br><br>whereas this works<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;rst.seek array(&quot;cpl&quot;),adseekfirsteq<br><br>Running a watch, the former value appears to be equal to the value &quot;cpl&quot; so should work. Maybe its something to do with the seek method using an array of variants?<br><br>I have also confirmed that the seek method causes the problem even though the method is supported by ADO (using blnvalue=rst.supports(adseek))<br><br>---<br><br>Obviously, because you can't put &quot;cpl&quot; or any other user name into the seek method, this method cannot be used. I found that using .movenext worked fine though.<br><br>---<br><br>No idea why Access remains 'open' in the background though - can anyone else shed some light?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top