Access never opens (appears)

M

Maury Markowitz

I have a long-standing problem that I have been trying to solve for a
very long time, with no luck.

I have a complex Access ADP "application" that is deployed to a number
of desktops. On startup it does a number of checks with the database
for login, security, etc. Periodically, without any apparent pattern,
the app will simply not open when double clicked. You can see that
MSACCESS is running in the Processes tab of Task Manager. It _appears_
that it has opened the window in some unknown location. If you force
quit MSACCESS and restart the application everything works fine. It is
not a db problem, there are no errors being reported on either end.

Has anyone else encountered this before? Either way, can anyone offer
some suggestions on how to correct or workaround the problem? I would
consider using an external plugin to force quit the application, but
there are other access apps that are also being run, so unless there
is some way to identify the correct instance I'd like to avoid that.

Any advice?

Maury
 
A

aaron.kempf

yah I've seen this with MDB and ADP.

Do you do Access Automation?

Dim acc as new Access.Application
acc.OpenDatabase "", ""
and of course
acc.visible = False

'Do Code

acc.Visible = True

etc etc

I don't want to state the obvious; but if you're doing something like
this then you've got to make sure and make the app visible
(acc.visible = True would do that in the above example).

Also; I would reccomend using NOLOCK on a long-running queries and see
if that helps; it shouldn't be necessary but whenever I have wierdness
like this; it's one of the first things I try.

-Aaron
 
A

aaron.kempf

Also.. are you using DAO or anything fishy?

show me a page of sample code; how do you do declarations; etc?

Do you use things like

Dim rst as new ADODB.recordset

sometimes it is required to explicitly close these items.. I just
can't narrow down the symptoms without knowing more information about
your coding (style)

hth so far-

-Aaron
 
N

Norman Yuan

The OP said "ADP".
No DAO stuff is invoilved.

Also.. are you using DAO or anything fishy?

show me a page of sample code; how do you do declarations; etc?

Do you use things like

Dim rst as new ADODB.recordset

sometimes it is required to explicitly close these items.. I just
can't narrow down the symptoms without knowing more information about
your coding (style)

hth so far-

-Aaron
 
A

aaron.kempf

I'm not so sure that is a foregone conclusion.

A lot of people try to use DAO. What do you not know how to use SQL
Server with DAO?

Having a hanging version of a hidden database??
THAT SOUNDS AWFULLY LIKE DAO TO ME

Thanks

-Aaron
 
A

aaron.kempf

Norman;

here is an example of using DAO against SQL Server.

It is typical for people to try to do this because they hear misguided
information about ADO vs DAO (in this newsgroup).
Personally; there isn't a reason for anyone to use DAO anywhere for
any reason.

It is easier and faster in ADO. Case closed.
But he might be trying to do something fishy with DAO.. and that is
the first place I'd look.

-Aaron

From
http://www.thescripts.com/forum/thread528851.html


Public Sub BinaryTest2()
Dim wks As DAO.Workspace
Dim con As DAO.Connection
Dim rsMyRS As DAO.Recordset
Dim data() As Byte

Set wks = CreateWorkspace("wks1", "admin", "", dbUseODBC)
'Set con = wks.OpenConnection("Escona", , , "Driver={SQL Native
Client};Server=marcus\sqlexpress;Database=test_bin
ary;UID=sa;PWD=1qaz2wsx;")
Set con = wks.OpenConnection("test", , , "ODBC;Driver={SQL
Server};Server=marcus\sqlexpress;Database=test_bin
ary;Uid=sa;Pwd=1qaz2wsx")

Set rsMyRS = con.OpenRecordset("SELECT location from Devices ",
dbOpenSnapshot)

data = rsMyRS("GraphicEnabled") ' array of bytes

rsMyRS.Close
Set rsMyRS = Nothing
con.Close
Set con = Nothing
wks.Close
Set wks = Nothing

Do While Not rsMyRS.EOF
Debug.Print rsMyRS("GraphicEnabled")
data = rsMyRS("GraphicEnabled_BINARY")

Dim fileName As String
fileName = rsMyRS("GraphicEnabled")

Open fileName For Binary As #1
Put #1, , data
Close #1
rsMyRS.MoveNext
Loop
End Sub
 
T

Tom van Stiphout

On Thu, 20 Mar 2008 17:29:09 -0700 (PDT), "(e-mail address removed)"

IMHO:
ADP is an ADO-based solution, so use ADO exclusively.
MDB is a DAO-based solution, so use DAO exclusively.
There are sensible exceptions to these rules, but they are only to be
used by those who have a deep knowledge and can explain their
deviations clearly.

-Tom.
 
A

aaron.kempf

I agree.

I just was clarifying that the guy wasn't using DAO.

I really don't understand the 'MDB is a DAO-based solution'

the DAO library was not checked by default in Access 2000 and 2002.
Are you trying to rewrite history?

I believe in ADO everywhere always. I believe that it's faster and
easier than DAO.
I just wanted to verify-- because it sounds like this guy is hitting a
DAO bug.

Having a database that stays open - behind the scenes - is the reason
I stopped using DAO a decade ago.

Thanks

-Aaron
 
T

Tom van Stiphout

On Fri, 21 Mar 2008 09:32:41 -0700 (PDT), "(e-mail address removed)"

What I meant is: DAO is the native library for the JET database
engine.
If ADO works better for you by all means stick with it. For most
applications either library will work well.

-Tom.
 
T

Tony Toews [MVP]

Maury Markowitz said:
I have a long-standing problem that I have been trying to solve for a
very long time, with no luck.

I have a complex Access ADP "application" that is deployed to a number
of desktops. On startup it does a number of checks with the database
for login, security, etc. Periodically, without any apparent pattern,
the app will simply not open when double clicked. You can see that
MSACCESS is running in the Processes tab of Task Manager. It _appears_
that it has opened the window in some unknown location. If you force
quit MSACCESS and restart the application everything works fine. It is
not a db problem, there are no errors being reported on either end.

The standard answer to this is the following:

Access minimizes to Windows 95/NT toolbar instead of closing
http://www.mvps.org/access/bugs/bugs0005.htm

however I do not know how much of this applies to ADPs.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

Maury Markowitz

Do you do Access Automation?

I am not sure exactly what you mean here... is "Access Automation"
something specific or do you mean "do you do coding in VBA in Access:?
acc.Visible = True

Should I try this even if I never use Visible=false?

Maury
 
M

Maury Markowitz

The OP said "ADP".
No DAO stuff is invoilved.

Actually there is, only a little though. In fact, I think the small
queries that run on startup (which look up user names in a table) may
use this! I will experiment with this ASAP.

Maury
 
A

aaron.kempf

wait a second Tony-- I thought that you didn't believe in this bug.
I mean-- anyone with a clue-- that saw this bug in DAO-- would move to
ADO.

What a stupid moron

-Aaron
 
A

aaron.kempf

look asshole-- I'm the one that first diagnosed it as a piece of shit
DAO problem
stick a cork in it

thanks

-Aaron
 
A

aaron.kempf

ah don't worry about it-- if you don't know what im talking about then
you're problably not using it!
Access Automation = 'one instance launching another instance and doing
things with VBA'

-Aaron
 
M

Maury Markowitz

ah don't worry about it-- if you don't know what im talking about then
you're problably not using it!
Access Automation = 'one instance launching another instance and doing
things with VBA'

Uhhh oh. Here's my startup function...

Public Const thisVersion = "7.0.8"

Public Function OpenStartupForm()
' check the version and offer to update
Call CheckVersions

' turn off rowcount returns to avoid problems
DoCmd.RunSQL "SET NOCOUNT ON"
End Function

I forget why I do the NOCOUNT, I seem to recall I was told to to avoid
some other problem. Does DoCmd.RunSQL use DAO? Here's the sub that
gets called...

Public Sub CheckVersions()
Const q As String * 1 = """"

' get the server version, remember that the client version is
entered above
latestVersion = DLookup("version", "tblApplications", "name =
'TicketWriter'")
If thisVersion = latestVersion Then Exit Sub

strMsg = "You are not running the latest version of TicketWriter."
& vbCrLf & vbCrLf & _
"Would you like to download the latest version?"
If MsgBox(strMsg, vbExclamation + vbYesNo, "Update Client?") =
vbYes Then
updater = DLookup("updaterpath", "tblApplications", "name =
'TicketWriter'")
runner = "MSAccess.exe " & q & updater & q
Shell runner, vbNormalFocus
DoCmd.Quit
End If
End Sub

Here I use DLookup (soon to be removed...) and then, optionally, shell
out. Note that the problem cases I am seeing are NOT when the shelling
out actually happens. In fact, I've never seen it have a problem then.

Maury
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top