Refreshing database window

  • Thread starter kkk via AccessMonster.com
  • Start date
K

kkk via AccessMonster.com

I have created adp project with microsoft access 2000 frontend and sql server
200 backend. I am creating few stored procedures and views at run time
according to my business need. After creating them i am trying to open them
but i am having a error 'this object is not exist'. If i go to the database
window and click views and press f5 and then go to stored procedures window
and then press f5 then i can see them and able to open them. But users not
going to see the database window. how i can programmatically manage to
refresh database window so it doesn't complain about object not exist.

I have already tried
application.refreshdatabase window
but it does not work.
I have already tried

Application.Echo False
DoCmd.Hourglass True
SendKeys "{F11}", True
DoCmd.RunCommand acCmdViewStoredProcedures
SendKeys "{f5}", True
DoCmd.RunCommand acCmdWindowHide
DoCmd.Maximize
Application.Echo True
DoCmd.Hourglass False
but it gives me error "error 2046: The command or action
'viewstoredprocedures' isn't available now"
Please give me advise how i can fix this problem.

Thanks
 
S

Sylvain Lafontaine

Not sure of that but possibly that refreshdatabase should work OK if you set
up a time-out of a few seconds in order to be able to access the new SP/View
after their creation.

Other solutions might be available to you, like creating and running the
(temporary?) SP inside an already existing SP, calling it directly without
refreshing the database window, using ADO objects or use another algorithm
to get the needed results for your business need.
 
S

Sylvain Lafontaine

Oups! , you are using A2000, see:
http://support.microsoft.com/kb/304256

Even with the method, possibly that you will still need the time-out between
the creation of the SP and the seeing it after a call to
RefreshDatabaseWindow.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


Sylvain Lafontaine said:
Not sure of that but possibly that refreshdatabase should work OK if you
set up a time-out of a few seconds in order to be able to access the new
SP/View after their creation.

Other solutions might be available to you, like creating and running the
(temporary?) SP inside an already existing SP, calling it directly without
refreshing the database window, using ADO objects or use another algorithm
to get the needed results for your business need.
 
R

Robert Morley

The code I use is as follows, and it works fine. It's functionally
identical to your code (with the exception that it's working on Views only),
but maybe there's a typo or something else in your code that you're just not
seeing.

With Application
.Echo False
SendKeys "{F11}", True
DoCmd.RunCommand acCmdViewViews
.RefreshDatabaseWindow
On Error Goto 0
DoCmd.RunCommand acCmdWindowHide
.Echo True
End With

Try this with acCmdViewViews first then acCmdViewStoredProcedures, and if
neither works, then you'll have to figure out what it is that's making those
commands unavailable...perhaps you've got something else running, or F11
isn't working properly or something. If you can't figure it out, try
removing the ".Echo False" and step through it to see if it seems to be
doing what you expect or not.



Rob
 
U

Uwe Ricken

Hi KK

you don't have to update your object container if you use

SELECT * FROM dbo.yourView
instead of
dbo.YourView

as the recordsource for a form / report.

HTH ;-)

--
Gruß, Uwe Ricken
MCP for SQL Server 2000 Database Implementation

db-Berater GmbH i. G. 64390 Erzhausen
http://www.db-berater.de
http://www.memberadmin.de
http://www.conferenceadmin.de
____________________________________________________
dbdev: http://www.dbdev.org
APP: http://www.AccessProfiPool.de
FAQ: http://www.donkarl.com/AccessFAQ.htm
 

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